From: David Heidelberger <david.heidelberger@ixit.cz>
To: linux-kernel@vger.kernel.org
Cc: maillist-linux@barfooze.de
Subject: [PATCH 3/4] libc-compat.h: fix some issues arising from in6.h
Date: Fri, 14 Mar 2014 17:15:49 +0100 [thread overview]
Message-ID: <13cd9a2535456ada92da2aaaeb377f85@ixit.cz> (raw)
namely redefinition of some structs provided by netinet/in.h.
Signed-off-by: John Spencer <maillist-linux@barfooze.de>
Tested-by: David Heidelberger <david.heidelberger@ixit.cz>
---
include/uapi/linux/libc-compat.h | 25 ++++++++-----------------
1 file changed, 8 insertions(+), 17 deletions(-)
diff --git a/include/uapi/linux/libc-compat.h
b/include/uapi/linux/libc-compat.h
index 335e8a7..c16c34c 100644
--- a/include/uapi/linux/libc-compat.h
+++ b/include/uapi/linux/libc-compat.h
@@ -48,35 +48,26 @@
#ifndef _UAPI_LIBC_COMPAT_H
#define _UAPI_LIBC_COMPAT_H
-/* We have included glibc headers... */
-#if defined(__GLIBC__)
+#ifndef __KERNEL__ /* we're used from userspace */
-/* Coordinate with glibc netinet/in.h header. */
-#if defined(_NETINET_IN_H)
+/* Coordinate with libc netinet/in.h header. */
+#ifdef _NETINET_IN_H
/* GLIBC headers included first so don't define anything
* that would already be defined. */
#define __UAPI_DEF_IN6_ADDR 0
-/* The exception is the in6_addr macros which must be defined
- * if the glibc code didn't define them. This guard matches
- * the guard in glibc/inet/netinet/in.h which defines the
- * additional in6_addr macros e.g. s6_addr16, and s6_addr32. */
-#if defined(__USE_MISC) || defined (__USE_GNU)
#define __UAPI_DEF_IN6_ADDR_ALT 0
-#else
-#define __UAPI_DEF_IN6_ADDR_ALT 1
-#endif
#define __UAPI_DEF_SOCKADDR_IN6 0
#define __UAPI_DEF_IPV6_MREQ 0
#define __UAPI_DEF_IPPROTO_V6 0
-#else
+#else /* defined(_NETINET_IN_H) */
/* Linux headers included first, and we must define everything
- * we need. The expectation is that glibc will check the
+ * we need. The expectation is that the libc will check the
* __UAPI_DEF_* defines and adjust appropriately. */
#define __UAPI_DEF_IN6_ADDR 1
-/* We unconditionally define the in6_addr macros and glibc must
+/* We unconditionally define the in6_addr macros and the libc must
* coordinate. */
#define __UAPI_DEF_IN6_ADDR_ALT 1
#define __UAPI_DEF_SOCKADDR_IN6 1
@@ -89,7 +80,7 @@
/* If we did not see any headers from any supported C libraries,
* or we are being included in the kernel, then define everything
* that we need. */
-#else /* !defined(__GLIBC__) */
+#else /* __KERNEL__ */
/* Definitions for in6.h */
#define __UAPI_DEF_IN6_ADDR 1
@@ -98,6 +89,6 @@
#define __UAPI_DEF_IPV6_MREQ 1
#define __UAPI_DEF_IPPROTO_V6 1
-#endif /* __GLIBC__ */
+#endif /* __KERNEL__ */
#endif /* _UAPI_LIBC_COMPAT_H */
--
1.8.4
reply other threads:[~2014-03-14 15:22 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=13cd9a2535456ada92da2aaaeb377f85@ixit.cz \
--to=david.heidelberger@ixit.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=maillist-linux@barfooze.de \
/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;
as well as URLs for NNTP newsgroup(s).