./sysdeps/unix/sysv/linux/sys/sysctl.h contains: /* Prevent more kernel headers than necessary to be included. */ #ifndef _LINUX_KERNEL_H # define _LINUX_KERNEL_H 1 # define __undef_LINUX_KERNEL_H #endif #ifndef _LINUX_TYPES_H # define _LINUX_TYPES_H 1 # define __undef_LINUX_TYPES_H #endif #ifndef _LINUX_LIST_H # define _LINUX_LIST_H 1 # define __undef_LINUX_LIST_H #endif #ifndef __LINUX_COMPILER_H # define __LINUX_COMPILER_H 1 # define __user # define __undef__LINUX_COMPILER_H #endif But starting with kernel 3.7, the feature test macros are _UAPI_LINUX_KERNEL_H and _UAPI_LINUX_TYPES_H (and no file uses *_LIST_H or *_COMPILER_H AFAICT) As such the above doesn't work and third party apps that include the (in)correct mix of header files don't compile due to conflicting types, e.g. include both <stdint.h> and <sys/sysctl.h> in one source file.
s/feature test/header guard/
Thanks for the bug report, patch posted at: http://sourceware.org/ml/libc-alpha/2012-11/msg00239.html
Fixed for head, will submit later for glibc 2.16/2.15 (after approval by Carlos)
OK for 2.16/2.15. Slightly off-topic: I didn't know we had to manually maintain those header guards to prevent other headers from being included when we include the kernel version. Do we really need to maintain this? Is this simply an optimization to reduce the amount of cpp work that is done for this header?
Carlos, see the original comment: We get types declared twice. I'm pushing this now to 2.16 and 2.15 branches.
The kernel has been fixed, so this is no longer needed. No released kernel will have this issue.
The patch has been reverted since it was a kernel bug.