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: Using <linux/stat.h> for _GNU_SOURCE


On Mon, 6 Nov 2017, Florian Weimer wrote:

> Would it be possible to include <linux/stat.h> (not <asm/stat.h>) from
> <sys/stat.h> for _GNU_SOURCE?  We'd need to add redefinition guards for the
> S_* macros defined in <linux/stat.h>, but otherwise, the header looks quite
> clean.

S_* appear to have conditionals

#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)

in <linux/stat.h>, so I don't think any guards are needed.

> This would allow us to obtain the STX_* constants and struct statx from the
> uapi header, without maintaining our own copy of that information. Or wouldn't

Note that if you start using any such constants and types in glibc such 
that they need to be available when glibc is built, that would imply a 
major change in the minimum supported kernel headers version for building 
glibc (as opposed to the minimum kernel version supported at runtime, so 
less problematic), from 3.2 to 4.11.

-- 
Joseph S. Myers
joseph@codesourcery.com


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