linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] linux/{socket,stat}.h: change __GLIBC__ cruft to __KLIBC__
@ 2008-01-02 14:37 Mike Frysinger
  2008-01-02 15:13 ` Adrian Bunk
  0 siblings, 1 reply; 4+ messages in thread
From: Mike Frysinger @ 2008-01-02 14:37 UTC (permalink / raw)
  To: Andrew Morton, LKML

The __GLIBC__ hacks were re-added to the headers because the klibc peeps want
to be lazy.  But rather than properly address things, they just wrongly left
it as __GLIBC__.  This patch changes the __GLIBC__ cruft to __KLIBC__ so real
libcs don't get screwed due to kilbc's laziness.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
diff --git a/include/linux/socket.h b/include/linux/socket.h
index c22ef1c..90af15b 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)
+#if defined(__KERNEL__) || defined(__KLIBC__)
 
 #include <asm/socket.h>			/* arch-dependent defines	*/
 #include <linux/sockios.h>		/* the SIOCxxx I/O controls	*/
diff --git a/include/linux/stat.h b/include/linux/stat.h
index 611c398..e8c1943 100644
--- a/include/linux/stat.h
+++ b/include/linux/stat.h
@@ -7,7 +7,7 @@
 
 #endif
 
-#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
+#if defined(__KERNEL__) || defined(__KLIBC__)
 
 #define S_IFMT  00170000
 #define S_IFSOCK 0140000

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

* Re: [patch] linux/{socket,stat}.h: change __GLIBC__ cruft to __KLIBC__
  2008-01-02 14:37 [patch] linux/{socket,stat}.h: change __GLIBC__ cruft to __KLIBC__ Mike Frysinger
@ 2008-01-02 15:13 ` Adrian Bunk
  2008-01-02 15:47   ` Mike Frysinger
  0 siblings, 1 reply; 4+ messages in thread
From: Adrian Bunk @ 2008-01-02 15:13 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: Andrew Morton, LKML

On Wed, Jan 02, 2008 at 09:37:50AM -0500, Mike Frysinger wrote:
> The __GLIBC__ hacks were re-added to the headers because the klibc peeps want
> to be lazy.  But rather than properly address things, they just wrongly left
> it as __GLIBC__.  This patch changes the __GLIBC__ cruft to __KLIBC__ so real
> libcs don't get screwed due to kilbc's laziness.
> 
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> ---
> diff --git a/include/linux/socket.h b/include/linux/socket.h
> index c22ef1c..90af15b 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)
> +#if defined(__KERNEL__) || defined(__KLIBC__)
>...

This changes the semantics from "!glibc" to "klibc".

I'm a bit worried that such changes might break some of the other 
libc's people use on Linux.

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


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

* Re: [patch] linux/{socket,stat}.h: change __GLIBC__ cruft to __KLIBC__
  2008-01-02 15:13 ` Adrian Bunk
@ 2008-01-02 15:47   ` Mike Frysinger
  2008-01-02 18:16     ` H. Peter Anvin
  0 siblings, 1 reply; 4+ messages in thread
From: Mike Frysinger @ 2008-01-02 15:47 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: Andrew Morton, LKML

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

On Wednesday 02 January 2008, Adrian Bunk wrote:
> On Wed, Jan 02, 2008 at 09:37:50AM -0500, Mike Frysinger wrote:
> > The __GLIBC__ hacks were re-added to the headers because the klibc peeps
> > want to be lazy.  But rather than properly address things, they just
> > wrongly left it as __GLIBC__.  This patch changes the __GLIBC__ cruft to
> > __KLIBC__ so real libcs don't get screwed due to kilbc's laziness.
> >
> > Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> > ---
> > diff --git a/include/linux/socket.h b/include/linux/socket.h
> > index c22ef1c..90af15b 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)
> > +#if defined(__KERNEL__) || defined(__KLIBC__)
> >...
>
> This changes the semantics from "!glibc" to "klibc".

that's the point

> I'm a bit worried that such changes might break some of the other
> libc's people use on Linux.

such libc's are broken and it isnt the kernel's problem to cater to broken 
libc's.  the problem is that these headers are breaking things *now* for 
valid libc's that are not glibc.  removal of __GBLIC__ was already accepted 
once but reverted for klibc.
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 835 bytes --]

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

* Re: [patch] linux/{socket,stat}.h: change __GLIBC__ cruft to __KLIBC__
  2008-01-02 15:47   ` Mike Frysinger
@ 2008-01-02 18:16     ` H. Peter Anvin
  0 siblings, 0 replies; 4+ messages in thread
From: H. Peter Anvin @ 2008-01-02 18:16 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: Adrian Bunk, Andrew Morton, LKML

Mike Frysinger wrote:
>>>
>>> -#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
>>> +#if defined(__KERNEL__) || defined(__KLIBC__)
>>> ...
>> This changes the semantics from "!glibc" to "klibc".
> 
> that's the point
> 
>> I'm a bit worried that such changes might break some of the other
>> libc's people use on Linux.
> 
> such libc's are broken and it isnt the kernel's problem to cater to broken 
> libc's.  the problem is that these headers are breaking things *now* for 
> valid libc's that are not glibc.  removal of __GBLIC__ was already accepted 
> once but reverted for klibc.
> -mike

Either of these really is wrong... it's the userspace which should ask 
for what should be imported; the kernel shouldn't hard-code which libcs 
want what.

I just posted a patch to the netdev list which splits the top of 
<linux/socket.h> out into <linux/sockaddr.h>, userspace can choose to 
include one or the other.

	-hpa

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

end of thread, other threads:[~2008-01-02 18:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-02 14:37 [patch] linux/{socket,stat}.h: change __GLIBC__ cruft to __KLIBC__ Mike Frysinger
2008-01-02 15:13 ` Adrian Bunk
2008-01-02 15:47   ` Mike Frysinger
2008-01-02 18:16     ` 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).