* [PATCH net-2.6] Revert "net: Support inclusion of <linux/socket.h> before <sys/socket.h>"
@ 2009-11-12 2:00 Ben Hutchings
2009-11-12 2:51 ` David Miller
0 siblings, 1 reply; 5+ messages in thread
From: Ben Hutchings @ 2009-11-12 2:00 UTC (permalink / raw)
To: David Miller; +Cc: netdev, 538372
This reverts commit 9c501935a3cdcf6b1d35aaee3aa11c7a7051a305. That
commit caused <linux/rtnetlink.h> to require that <sys/socket.h> is
included first, breaking autoconf tests for <linux/rtnetlink.h> and
presumably some real programs too.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
Please apply this to net-2.6.
I'm not sure what the proper solution is; maybe make <linux/socket.h>
include <sys/socket.h> if __KERNEL__ is not defined?
Ben.
include/linux/socket.h | 21 ++++++++++++++++++---
1 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/include/linux/socket.h b/include/linux/socket.h
index 3273a0c..3b461df 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 */
-#ifdef __KERNEL__
+#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
#include <asm/socket.h> /* arch-dependent defines */
#include <linux/sockios.h> /* the SIOCxxx I/O controls */
@@ -101,6 +101,21 @@ struct cmsghdr {
((char *)(cmsg) - (char *)(mhdr)->msg_control)))
/*
+ * This mess will go away with glibc
+ */
+
+#ifdef __KERNEL__
+#define __KINLINE static inline
+#elif defined(__GNUC__)
+#define __KINLINE static __inline__
+#elif defined(__cplusplus)
+#define __KINLINE static inline
+#else
+#define __KINLINE static
+#endif
+
+
+/*
* Get the next cmsg header
*
* PLEASE, do not touch this function. If you think, that it is
@@ -113,7 +128,7 @@ struct cmsghdr {
* ancillary object DATA. --ANK (980731)
*/
-static inline struct cmsghdr * __cmsg_nxthdr(void *__ctl, __kernel_size_t __size,
+__KINLINE struct cmsghdr * __cmsg_nxthdr(void *__ctl, __kernel_size_t __size,
struct cmsghdr *__cmsg)
{
struct cmsghdr * __ptr;
@@ -125,7 +140,7 @@ static inline struct cmsghdr * __cmsg_nxthdr(void *__ctl, __kernel_size_t __size
return __ptr;
}
-static inline struct cmsghdr * cmsg_nxthdr (struct msghdr *__msg, struct cmsghdr *__cmsg)
+__KINLINE struct cmsghdr * cmsg_nxthdr (struct msghdr *__msg, struct cmsghdr *__cmsg)
{
return __cmsg_nxthdr(__msg->msg_control, __msg->msg_controllen, __cmsg);
}
--
1.6.5.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH net-2.6] Revert "net: Support inclusion of <linux/socket.h> before <sys/socket.h>"
2009-11-12 2:00 [PATCH net-2.6] Revert "net: Support inclusion of <linux/socket.h> before <sys/socket.h>" Ben Hutchings
@ 2009-11-12 2:51 ` David Miller
2009-11-12 3:05 ` Ben Hutchings
0 siblings, 1 reply; 5+ messages in thread
From: David Miller @ 2009-11-12 2:51 UTC (permalink / raw)
To: ben; +Cc: netdev, 538372
From: Ben Hutchings <ben@decadent.org.uk>
Date: Thu, 12 Nov 2009 02:00:05 +0000
> This reverts commit 9c501935a3cdcf6b1d35aaee3aa11c7a7051a305. That
> commit caused <linux/rtnetlink.h> to require that <sys/socket.h> is
> included first, breaking autoconf tests for <linux/rtnetlink.h> and
> presumably some real programs too.
>
> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
I'm not reverting this Ben. The dependency those programs and
autoconf tests have is _dubious_ at best.
It means they were depending upon the libc5 checks passing, that's
rediculious and not something we should cater to.
If you really want it to work that linux/rtnetlink.h is included first
before sys/socket.h in userland, fix that specifically instead. But
I believe such a dependency is reasonable and the userspace bits need
fixing.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-2.6] Revert "net: Support inclusion of <linux/socket.h> before <sys/socket.h>"
2009-11-12 2:51 ` David Miller
@ 2009-11-12 3:05 ` Ben Hutchings
2009-11-12 3:09 ` David Miller
0 siblings, 1 reply; 5+ messages in thread
From: Ben Hutchings @ 2009-11-12 3:05 UTC (permalink / raw)
To: David Miller; +Cc: netdev, 538372
[-- Attachment #1: Type: text/plain, Size: 1118 bytes --]
On Wed, 2009-11-11 at 18:51 -0800, David Miller wrote:
> From: Ben Hutchings <ben@decadent.org.uk>
> Date: Thu, 12 Nov 2009 02:00:05 +0000
>
> > This reverts commit 9c501935a3cdcf6b1d35aaee3aa11c7a7051a305. That
> > commit caused <linux/rtnetlink.h> to require that <sys/socket.h> is
> > included first, breaking autoconf tests for <linux/rtnetlink.h> and
> > presumably some real programs too.
> >
> > Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
>
> I'm not reverting this Ben. The dependency those programs and
> autoconf tests have is _dubious_ at best.
>
> It means they were depending upon the libc5 checks passing, that's
> rediculious and not something we should cater to.
[...]
Sorry, I'm getting my headers mixed up. The problem is with
<linux/netlink.h> not <linux/rtnetlink.h>.
<linux/netlink.h> will not compile for userland, because
<linux/socket.h> is no longer defining sa_family_t. For userland, this
should be defined by <sys/socket.h>.
Ben.
--
Ben Hutchings
Lowery's Law:
If it jams, force it. If it breaks, it needed replacing anyway.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-2.6] Revert "net: Support inclusion of <linux/socket.h> before <sys/socket.h>"
2009-11-12 3:05 ` Ben Hutchings
@ 2009-11-12 3:09 ` David Miller
2009-11-12 3:38 ` Ben Hutchings
0 siblings, 1 reply; 5+ messages in thread
From: David Miller @ 2009-11-12 3:09 UTC (permalink / raw)
To: ben; +Cc: netdev, 538372
From: Ben Hutchings <ben@decadent.org.uk>
Date: Thu, 12 Nov 2009 03:05:15 +0000
> <linux/netlink.h> will not compile for userland, because
> <linux/socket.h> is no longer defining sa_family_t. For userland, this
> should be defined by <sys/socket.h>.
Still, you still essentially have two choices:
1) Tell userland, sorry you need to include sys/socket.h before
other "socket stuff" and that means linux/netlink.h in
particular
2) Put a !__KERNEL__ sys/socket.h include in there, but that's
asking for trouble.
Ok?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-2.6] Revert "net: Support inclusion of <linux/socket.h> before <sys/socket.h>"
2009-11-12 3:09 ` David Miller
@ 2009-11-12 3:38 ` Ben Hutchings
0 siblings, 0 replies; 5+ messages in thread
From: Ben Hutchings @ 2009-11-12 3:38 UTC (permalink / raw)
To: Ulrich Drepper; +Cc: David Miller, netdev, 538372
[-- Attachment #1: Type: text/plain, Size: 1011 bytes --]
On Wed, 2009-11-11 at 19:09 -0800, David Miller wrote:
> From: Ben Hutchings <ben@decadent.org.uk>
> Date: Thu, 12 Nov 2009 03:05:15 +0000
>
> > <linux/netlink.h> will not compile for userland, because
> > <linux/socket.h> is no longer defining sa_family_t. For userland, this
> > should be defined by <sys/socket.h>.
>
> Still, you still essentially have two choices:
>
> 1) Tell userland, sorry you need to include sys/socket.h before
> other "socket stuff" and that means linux/netlink.h in
> particular
Which is just nasty; headers should include everything they need.
> 2) Put a !__KERNEL__ sys/socket.h include in there, but that's
> asking for trouble.
Indeed.
Including <bits/sockaddr.h> would get us exactly what we need, but
that's not meant to be included directly.
Ulrich, can you make any suggestions as to how we can resolve this?
Ben.
--
Ben Hutchings
Lowery's Law:
If it jams, force it. If it breaks, it needed replacing anyway.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-11-12 3:38 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-12 2:00 [PATCH net-2.6] Revert "net: Support inclusion of <linux/socket.h> before <sys/socket.h>" Ben Hutchings
2009-11-12 2:51 ` David Miller
2009-11-12 3:05 ` Ben Hutchings
2009-11-12 3:09 ` David Miller
2009-11-12 3:38 ` Ben Hutchings
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).