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
- From: Florian Weimer <fweimer at redhat dot com>
- To: Andreas Schwab <schwab at suse dot de>
- Cc: libc-alpha at sourceware dot org
- Date: Wed, 05 Jun 2019 17:16:21 +0200
- Subject: Re: [PATCH] <sys/stat.h>: Use Linux kernel UAPI header if available and useful
- References: <87zhmwt76d.fsf@oldenburg2.str.redhat.com> <mvmk1e05amr.fsf@suse.de>
* Andreas Schwab:
> On Jun 05 2019, Florian Weimer <fweimer@redhat.com> wrote:
>
>> * io/bits/statx.h: Fix typo in error message. Include
>> <linux/stat.h> is available. Define statx-related constants only
>
> s/is/if/
>
>> diff --git a/io/bits/statx.h b/io/bits/statx.h
>> index cff14b2543..d0dcc353ba 100644
>> --- a/io/bits/statx.h
>> +++ b/io/bits/statx.h
>> @@ -19,9 +19,14 @@
>> /* This interface is based on <linux/stat.h> in Linux. */
>>
>> #ifndef _SYS_STAT_H
>> -# error Never include <bits/stat.x.h> directly, include <sys/stat.h> instead.
>> +# error Never include <bits/statx.h> directly, include <sys/stat.h> instead.
>> #endif
>>
>> +#if __glibc_has_include (<linux/stat.h>)
>> +# include <linux/stat.h>
>> +#endif
>
> Wouldn't it be better to add sysdeps/unix/sysv/linux/bits/statx.h where
> <linux/stat.h> is included unconditionally?
I don't think <linux/stat.h> exists as an UAPI header in Linux 3.2,
which is currently the minimum kernel version. I think it was only
added in Linux 3.7.
Thanks,
Florian