This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] <sys/stat.h>: Use Linux kernel UAPI header if available and useful
* Andreas Schwab:
> On Jun 11 2019, Florian Weimer <fweimer@redhat.com> wrote:
>
>> Alternative, we could compile statx_generic separately and directly
>> include <io/bits/statx-generic.h>, bypassing the sysdeps search path.
>> But that means we cannot include <sys/stat.h>, but we need it for the
>> AT_* constants.
>
> If struct statx is put in a separate file it can be included twice, with
> arrangment for defining, say, struct statx_internal the second time.
You mean like this?
#include <sys/stat.h>
/* Change the tag of the struct definition. */
#define statx statx_original
#include <bits/types/struct_statx.h>
#undef statx
I still consider this a preprocessor hack. I would prefer the static
assert to this.
Thanks,
Florian