netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] scrub non-__GLIBC__ checks in linux/socket.h and linux/stat.h
@ 2006-12-16 18:42 Mike Frysinger
  2006-12-16 18:57 ` Erik Andersen
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Frysinger @ 2006-12-16 18:42 UTC (permalink / raw)
  To: linux-kernel, netdev, viro; +Cc: Alexey Dobriyan, Robert P. J. Day

[-- Attachment #1: Type: text/plain, Size: 722 bytes --]

On 11/30/06, Robert P. J. Day <rpjday@mindspring.com> wrote:
> but there are a few other
> cases which still contain compound preprocessor directives such as:
>
>   #if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
>
> having never worked with unifdef before, i guess i was being overly
> optimistic in thinking that it, if i "unifdef"ed __KERNEL__, it might
> at least simplify the expression.  oh, well ... live and learn.

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)
-mike

[-- Attachment #2: linux-scrub-GLIBC-ifdefs.patch --]
[-- Type: application/octet-stream, Size: 729 bytes --]

index 92cd38e..545c041 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -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	*/
index 679ef0d..59e6ba3 100644
--- a/include/linux/stat.h
+++ b/include/linux/stat.h
@@ -7,7 +7,7 @@
 
 #endif
 
-#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
+#ifdef __KERNEL__
 
 #define S_IFMT  00170000
 #define S_IFSOCK 0140000

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-01-25  6:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-16 18:42 [patch] scrub non-__GLIBC__ checks in linux/socket.h and linux/stat.h Mike Frysinger
2006-12-16 18:57 ` Erik Andersen
2007-01-25  6:30   ` H. Peter Anvin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).