提交 57a87bb0 编写于 作者: M Mike Frysinger 提交者: Linus Torvalds

[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: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 4564f9e5
......@@ -16,7 +16,7 @@ struct __kernel_sockaddr_storage {
/* _SS_MAXSIZE value minus size of ss_family */
} __attribute__ ((aligned(_K_SS_ALIGNSIZE))); /* force desired alignment */
#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
#ifdef __KERNEL__
#include <asm/socket.h> /* arch-dependent defines */
#include <linux/sockios.h> /* the SIOCxxx I/O controls */
......
......@@ -7,7 +7,7 @@
#endif
#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
#ifdef __KERNEL__
#define S_IFMT 00170000
#define S_IFSOCK 0140000
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册