[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 01/41] libshouldbeinlibc: Port to x86_64
From: |
Sergey Bugaev |
Subject: |
Re: [PATCH 01/41] libshouldbeinlibc: Port to x86_64 |
Date: |
Tue, 9 May 2023 00:44:57 +0300 |
On Tue, May 9, 2023 at 12:40 AM Samuel Thibault <samuel.thibault@gnu.org> wrote:
> > - size_t opts_len = sizeof opts;
> > + mach_msg_type_number_t opts_len = sizeof opts;
>
> ? That doesn't make sense, sizeof does return size_t.
sizeof returns size_t, yes. But this code later passes opts_len *by
pointer* to fsys_get_options (), which expects a value of type
mach_msg_type_number_t (or a pointer to that, rather).
So the fix here is not that the value sizeof evaluates to was being
saved to a wrong type, but that a wrong type was being passed to a
Mach RPC. I'm now casting the result of sizeof from size_t to
mach_msg_type_number_t, and passing that to fsys_get_options ().
I hope this makes sense now; and you're going to see *a lot* of
similar changes in this patchset.
Sergey
- [PATCH 00/41] The x86_64 port, Sergey Bugaev, 2023/05/08
- [PATCH 02/41] libports: Port to x86_64, Sergey Bugaev, 2023/05/08
- [PATCH 01/41] libshouldbeinlibc: Port to x86_64, Sergey Bugaev, 2023/05/08
- [PATCH 03/41] libiohelp: Port to x86_64, Sergey Bugaev, 2023/05/08
- [PATCH 04/41] libfshelp: Port to x86_64, Sergey Bugaev, 2023/05/08
- [PATCH 06/41] libtrivfs: Port to x86_64, Sergey Bugaev, 2023/05/08
- [PATCH 09/41] libstore: Port to x86_64, Sergey Bugaev, 2023/05/08
- [PATCH 05/41] libfshelp-tests: Port to x86_64, Sergey Bugaev, 2023/05/08
- [PATCH 07/41] libnetfs: Port to x86_64, Sergey Bugaev, 2023/05/08
- [PATCH 13/41] libmachdev: Port to x86_64, Sergey Bugaev, 2023/05/08
- [PATCH 08/41] libdiskfs: Port to x86_64, Sergey Bugaev, 2023/05/08
- [PATCH 10/41] libpipe: Fix use-after-realloc, Sergey Bugaev, 2023/05/08
- [PATCH 12/41] libps: Silence a warning, Sergey Bugaev, 2023/05/08