This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: statx struct's stx_size pointer compatibility with uint64_t/size_t
- From: Florian Weimer <fweimer at redhat dot com>
- To: Dominique Martinet <asmadeus at codewreck dot org>
- Cc: libc-help at sourceware dot org, Quentin Bouget <quentin dot bouget at cea dot fr>, Jeff Layton <jlayton at kernel dot org>, David Howells <dhowells at redhat dot com>
- Date: Tue, 17 Dec 2019 14:09:04 +0100
- Subject: Re: statx struct's stx_size pointer compatibility with uint64_t/size_t
- References: <20191217085918.GA19084@nautica>
* Dominique Martinet:
> What would be the "recommended" way of doing this?
> Any chance the field could change to be uint64_t-compatible in the
> future? Not sure what that implies regarding e.g. backwards
> compatibility though...
This is a tricky subject. We already have a copy of the type with
uint64_t fields in the installed glibc headers, but this is only used if
the kernel definition is not available.
We do not want to duplicate kernel headers too much because it causes
problems if both glibc headers and kernel headers are included in the
same translation unit. That in turn makes it difficult to use new
kernel features by only updating the kernel headers.
I do not know why the kernel definition of __u64 does not follow that of
uint64_t in <stdint.h> (or why we even have that __u64 type), and
whether the kernel definition can be changed at this point. We can fix
this issue with preprocessor magic, but I am not entirely sure if this
is a good idea.
If you want, you could bring this up on some kernel lists (at least
linux-api), and Cc: libc-alpha, or can do that for you.
Thanks,
Florian