mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Mike Frysinger" <vapier.adi@gmail.com>
To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	viro@zeniv.linux.org.uk
Cc: "Alexey Dobriyan" <adobriyan@gmail.com>,
	"Robert P. J. Day" <rpjday@mindspring.com>
Subject: [patch] scrub non-__GLIBC__ checks in linux/socket.h and linux/stat.h
Date: Sat, 16 Dec 2006 13:42:11 -0500	[thread overview]
Message-ID: <8bd0f97a0612161042g3b61d42csd54cae46e4864f30@mail.gmail.com> (raw)

[-- 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

             reply	other threads:[~2006-12-16 18:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-16 18:42 Mike Frysinger [this message]
2006-12-16 18:57 ` Erik Andersen
2007-01-25  6:30   ` H. Peter Anvin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8bd0f97a0612161042g3b61d42csd54cae46e4864f30@mail.gmail.com \
    --to=vapier.adi@gmail.com \
    --cc=adobriyan@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rpjday@mindspring.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®