This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] <sys/stat.h>: Use Linux kernel UAPI header if available and useful


* 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]