This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [glibc] <sys/stat.h>: Use Linux UAPI header for statx if available and useful
- From: Florian Weimer <fweimer at redhat dot com>
- To: Andreas Schwab <schwab at suse dot de>
- Cc: Szabolcs Nagy <Szabolcs dot Nagy at arm dot com>, nd <nd at arm dot com>, Zack Weinberg <zackw at panix dot com>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Thu, 04 Jul 2019 12:10:48 +0200
- Subject: Re: [glibc] <sys/stat.h>: Use Linux UAPI header for statx if available and useful
- References: <20190612110504.66041.qmail@sourceware.org> <87ftoe7utd.fsf@oldenburg2.str.redhat.com> <CAKCAbMj2G7_1bAuE+5X0qvNGMTMN9QenzOpgJmkwC4LK_mrGzA@mail.gmail.com> <87y3266czw.fsf@oldenburg2.str.redhat.com> <c35c19da-b775-3435-d38e-702f30bc6ac3@arm.com> <87ef3y6bpv.fsf@oldenburg2.str.redhat.com> <17fed83c-e000-ccbf-9900-104fc20a6273@arm.com> <874l4u6bad.fsf@oldenburg2.str.redhat.com> <2df99c26-7a4c-02ba-a50e-7557c5581a9b@arm.com> <87muiks0ur.fsf@oldenburg2.str.redhat.com> <mvmd0iqf6vl.fsf@suse.de>
* Andreas Schwab:
> On Jun 14 2019, Florian Weimer <fweimer@redhat.com> wrote:
>
>> diff --git a/sysdeps/unix/sysv/linux/bits/statx.h b/sysdeps/unix/sysv/linux/bits/statx.h
>> index d36f44efc6..206878723f 100644
>> --- a/sysdeps/unix/sysv/linux/bits/statx.h
>> +++ b/sysdeps/unix/sysv/linux/bits/statx.h
>> @@ -23,8 +23,11 @@
>> #endif
>>
>> /* Use the Linux kernel header if available. */
>> -#if __glibc_has_include (<linux/stat.h>)
>> -# include <linux/stat.h>
>> +
>> +/* Use "" to work around incorrect macro expansion of the
>> + __has_include argument (GCC PR 80005). */
>> +#if __glibc_has_include ("linux/stat.h")
>
> FWIW, this gets mangled by fixincludes:
>
> @@ -26,7 +35,7 @@
>
> /* Use "" to work around incorrect macro expansion of the
> __has_include argument (GCC PR 80005). */
> -#if __glibc_has_include ("linux/stat.h")
> +#if __glibc_has_include ("__linux__/stat.h")
> # include "linux/stat.h"
> # ifdef STATX_TYPE
> # define __statx_timestamp_defined 1
Yuck. Do you agree that fixincludes must be fixed?
Thanks,
Florian