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
On Jun 11 2019, Florian Weimer <fweimer@redhat.com> wrote:
> * 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.
It is only needed as long as the fallback is needed.
> I would prefer the static assert to this.
In any case, the assertion is in the wrong place, since only the
fallback needs it.
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."