LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* <linux/socket.h>, <linux/stat.h> breakage: AF_* constants are part of ABI definition
@ 2007-02-19 21:06 H. Peter Anvin
  2007-02-22 11:11 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: H. Peter Anvin @ 2007-02-19 21:06 UTC (permalink / raw)
  To: linux-kernel, Mike Frysinger; +Cc: David S. Miller

In the current git tree, commit 57a87bb0720a5cf7a9ece49a8c8ed288398fd1bb 
removes any way to automatically extracting a whole lot of ABI constants 
from the kernel headers, especially AF_* and the various S_* constants.

Furthermore, the patch breaks <linux/in.h> which uses sa_family_t, which 
is now defined under __KERNEL__.

The comment that is included:

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

... seems to imply that virtually nothing out of these files should be 
"sanely" utilized, but why, pray tell, include them at all?  The balance 
of these files is about 10 lines.

This patch breaks klibc in ways that are painfully hard to fix, and 
*definitely* cannot be fixed by anything less than replication of all 
these definitions, which is exactly the Wrong Thing[TM].

A much better solution (or complement) would be something like:

#if defined(__KERNEL__) || defined(__KHDR_CONSTANTS)

We could have __KHDR_CONSTANTS for the AF_* constants and __KHDR_MACROS 
for the various macros (cmsg et al).  That way the userspace library can 
ask for what it wants.

	-hpa


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

end of thread, other threads:[~2007-02-22 11:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-19 21:06 <linux/socket.h>, <linux/stat.h> breakage: AF_* constants are part of ABI definition H. Peter Anvin
2007-02-22 11:11 ` David Miller

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