mailing list of musl libc
 help / color / mirror / code / Atom feed
* [PATCH 1/1] make net/if.h suppress clashing definitions from kernel headers
@ 2017-03-20  5:41 Ralph Sennhauser
  0 siblings, 0 replies; only message in thread
From: Ralph Sennhauser @ 2017-03-20  5:41 UTC (permalink / raw)
  To: musl; +Cc: Ralph Sennhauser

The linux kernel uapi headers provide their own definitions of the
structures from net/if.h, resulting in errors when a program includes both
the standard libc header and one or more of the networking-related kernel
headers that pull in the kernel definitions.

As was done for netinet/in.h in 04983f227238 ("make netinet/in.h suppress
clashing definitions from kernel headers"), do not attempt to support the
case where kernel headers are included before the libc ones, since the
kernel definitions may have subtly incorrect types, namespace violations,
etc. However, support the inclusion of the kernel headers after the libc
ones, since the kernel headers provide a public interface for suppressing
their definitions. This patch adds the necessary macro definitions for such
suppression.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
---

Hi everyone,

Just like commit 04983f227238 ("make netinet/in.h suppress clashing
definitions from kernel headers") this patch needs changes to to the
kernels libc-compat.h. The required patch to make this work was submitted
by Felix Janda [1], but inclusion got apparently stalled.

Commit 04983f227238, this one and the one for the kernel allow to build a
large portion of packages to be built without modifications against Musl
libc.

[1] https://lkml.org/lkml/2016/11/11/210

Ralph

PS: I'm not subscribed, so please keep my CC

---

 include/net/if.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/include/net/if.h b/include/net/if.h
index 2f2fcc1..3e7587a 100644
--- a/include/net/if.h
+++ b/include/net/if.h
@@ -125,6 +125,12 @@ struct ifconf {
 #define ifc_req		ifc_ifcu.ifcu_req
 #define _IOT_ifconf _IOT(_IOTS(struct ifconf),1,0,0,0,0)
 
+#define __UAPI_DEF_IF_IFCONF 0
+#define __UAPI_DEF_IF_IFMAP 0
+#define __UAPI_DEF_IFREQ 0
+#define __UAPI_DEF_IF_NET_DEVICE_FLAGS 0
+#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 0
+
 #endif
 
 #ifdef __cplusplus
-- 
2.10.2



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-03-20  5:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-20  5:41 [PATCH 1/1] make net/if.h suppress clashing definitions from kernel headers Ralph Sennhauser

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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