Lines 48-60
Link Here
|
48 |
#ifndef _UAPI_LIBC_COMPAT_H |
48 |
#ifndef _UAPI_LIBC_COMPAT_H |
49 |
#define _UAPI_LIBC_COMPAT_H |
49 |
#define _UAPI_LIBC_COMPAT_H |
50 |
|
50 |
|
51 |
/* We have included glibc headers... */ |
51 |
#ifndef __KERNEL__ /* we're used from userspace */ |
52 |
#if defined(__GLIBC__) |
|
|
53 |
|
52 |
|
54 |
/* Coordinate with glibc netinet/in.h header. */ |
53 |
#ifdef _NETINET_IF_ETHER_H /* musl */ |
|
|
54 |
#define __UAPI_DEF_ETHHDR 0 |
55 |
#else /* glibc uses __NETINET_IF_ETHER_H, and includes the kernel header. */ |
56 |
#define __UAPI_DEF_ETHHDR 1 |
57 |
#endif |
58 |
|
59 |
/* Coordinate with libc netinet/in.h header. */ |
55 |
#if defined(_NETINET_IN_H) |
60 |
#if defined(_NETINET_IN_H) |
56 |
|
61 |
|
57 |
/* GLIBC headers included first so don't define anything |
62 |
/* libc headers included first so don't define anything |
58 |
* that would already be defined. */ |
63 |
* that would already be defined. */ |
59 |
#define __UAPI_DEF_IN_ADDR 0 |
64 |
#define __UAPI_DEF_IN_ADDR 0 |
60 |
#define __UAPI_DEF_IN_IPPROTO 0 |
65 |
#define __UAPI_DEF_IN_IPPROTO 0 |
Lines 64-78
Link Here
|
64 |
#define __UAPI_DEF_IN_CLASS 0 |
69 |
#define __UAPI_DEF_IN_CLASS 0 |
65 |
|
70 |
|
66 |
#define __UAPI_DEF_IN6_ADDR 0 |
71 |
#define __UAPI_DEF_IN6_ADDR 0 |
67 |
/* The exception is the in6_addr macros which must be defined |
|
|
68 |
* if the glibc code didn't define them. This guard matches |
69 |
* the guard in glibc/inet/netinet/in.h which defines the |
70 |
* additional in6_addr macros e.g. s6_addr16, and s6_addr32. */ |
71 |
#if defined(__USE_MISC) || defined (__USE_GNU) |
72 |
#define __UAPI_DEF_IN6_ADDR_ALT 0 |
72 |
#define __UAPI_DEF_IN6_ADDR_ALT 0 |
73 |
#else |
|
|
74 |
#define __UAPI_DEF_IN6_ADDR_ALT 1 |
75 |
#endif |
76 |
#define __UAPI_DEF_SOCKADDR_IN6 0 |
73 |
#define __UAPI_DEF_SOCKADDR_IN6 0 |
77 |
#define __UAPI_DEF_IPV6_MREQ 0 |
74 |
#define __UAPI_DEF_IPV6_MREQ 0 |
78 |
#define __UAPI_DEF_IPPROTO_V6 0 |
75 |
#define __UAPI_DEF_IPPROTO_V6 0 |
Lines 80-89
Link Here
|
80 |
#define __UAPI_DEF_IN6_PKTINFO 0 |
77 |
#define __UAPI_DEF_IN6_PKTINFO 0 |
81 |
#define __UAPI_DEF_IP6_MTUINFO 0 |
78 |
#define __UAPI_DEF_IP6_MTUINFO 0 |
82 |
|
79 |
|
83 |
#else |
80 |
#else /* defined(_NETINET_IN_H) */ |
84 |
|
81 |
|
85 |
/* Linux headers included first, and we must define everything |
82 |
/* Linux headers included first, and we must define everything |
86 |
* we need. The expectation is that glibc will check the |
83 |
* we need. The expectation is that libc will check the |
87 |
* __UAPI_DEF_* defines and adjust appropriately. */ |
84 |
* __UAPI_DEF_* defines and adjust appropriately. */ |
88 |
#define __UAPI_DEF_IN_ADDR 1 |
85 |
#define __UAPI_DEF_IN_ADDR 1 |
89 |
#define __UAPI_DEF_IN_IPPROTO 1 |
86 |
#define __UAPI_DEF_IN_IPPROTO 1 |
Lines 93-99
Link Here
|
93 |
#define __UAPI_DEF_IN_CLASS 1 |
90 |
#define __UAPI_DEF_IN_CLASS 1 |
94 |
|
91 |
|
95 |
#define __UAPI_DEF_IN6_ADDR 1 |
92 |
#define __UAPI_DEF_IN6_ADDR 1 |
96 |
/* We unconditionally define the in6_addr macros and glibc must |
93 |
/* We unconditionally define the in6_addr macros and libc must |
97 |
* coordinate. */ |
94 |
* coordinate. */ |
98 |
#define __UAPI_DEF_IN6_ADDR_ALT 1 |
95 |
#define __UAPI_DEF_IN6_ADDR_ALT 1 |
99 |
#define __UAPI_DEF_SOCKADDR_IN6 1 |
96 |
#define __UAPI_DEF_SOCKADDR_IN6 1 |
Lines 115-121
Link Here
|
115 |
/* If we did not see any headers from any supported C libraries, |
112 |
/* If we did not see any headers from any supported C libraries, |
116 |
* or we are being included in the kernel, then define everything |
113 |
* or we are being included in the kernel, then define everything |
117 |
* that we need. */ |
114 |
* that we need. */ |
118 |
#else /* !defined(__GLIBC__) */ |
115 |
#else /* __KERNEL__ */ |
119 |
|
116 |
|
120 |
/* Definitions for in.h */ |
117 |
/* Definitions for in.h */ |
121 |
#define __UAPI_DEF_IN_ADDR 1 |
118 |
#define __UAPI_DEF_IN_ADDR 1 |
Lines 138-143
Link Here
|
138 |
/* Definitions for xattr.h */ |
135 |
/* Definitions for xattr.h */ |
139 |
#define __UAPI_DEF_XATTR 1 |
136 |
#define __UAPI_DEF_XATTR 1 |
140 |
|
137 |
|
141 |
#endif /* __GLIBC__ */ |
138 |
#endif /* __KERNEL__ */ |
142 |
|
139 |
|
143 |
#endif /* _UAPI_LIBC_COMPAT_H */ |
140 |
#endif /* _UAPI_LIBC_COMPAT_H */ |