Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] scrub non-__GLIBC__ checks in linux/socket.h and linux/stat.h

Userspace should be worrying about userspace, so having the socket.h
and stat.h pollute the namespace in the non-glibc case is wrong and
pretty much prevents any other libc from utilizing these headers
sanely unless they set up the __GLIBC__ define themselves (which
sucks)

Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Mike Frysinger and committed by
Linus Torvalds
57a87bb0 4564f9e5

+2 -2
+1 -1
include/linux/socket.h
··· 16 16 /* _SS_MAXSIZE value minus size of ss_family */ 17 17 } __attribute__ ((aligned(_K_SS_ALIGNSIZE))); /* force desired alignment */ 18 18 19 - #if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) 19 + #ifdef __KERNEL__ 20 20 21 21 #include <asm/socket.h> /* arch-dependent defines */ 22 22 #include <linux/sockios.h> /* the SIOCxxx I/O controls */
+1 -1
include/linux/stat.h
··· 7 7 8 8 #endif 9 9 10 - #if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) 10 + #ifdef __KERNEL__ 11 11 12 12 #define S_IFMT 00170000 13 13 #define S_IFSOCK 0140000