0002-add-additional-uapi-guards-for-Linux-kernel-header-f.patch 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. From b583c5d3b4cc2c54c68eef5eb7855ecfacee8bfc Mon Sep 17 00:00:00 2001
  2. From: Hauke Mehrtens <hauke@hauke-m.de>
  3. Date: Sat, 6 Jan 2018 23:32:52 +0100
  4. Subject: [PATCH] add additional uapi guards for Linux kernel header files
  5. With Linux kernel 4.16 it will be possible to guard more parts of the
  6. Linux header files from a libc. Make use of this in musl to guard all
  7. the structures and other definitions from the Linux header files which
  8. are also defined by the header files provided by musl. This will make
  9. it possible to compile source files which include both the libc
  10. headers and the kernel userspace headers.
  11. This extends the definitions done in commit 04983f227238 ("make
  12. netinet/in.h suppress clashing definitions from kernel headers")
  13. Signed-off-by: Baruch Siach <baruch@tkos.co.il>
  14. ---
  15. Patch status: upstream commit b583c5d3b4cc
  16. include/net/if.h | 7 +++++++
  17. include/netinet/if_ether.h | 1 +
  18. include/sys/xattr.h | 2 ++
  19. 3 files changed, 10 insertions(+)
  20. diff --git a/include/net/if.h b/include/net/if.h
  21. index 2f2fcc10e484..774cbff0b506 100644
  22. --- a/include/net/if.h
  23. +++ b/include/net/if.h
  24. @@ -125,6 +125,13 @@ struct ifconf {
  25. #define ifc_req ifc_ifcu.ifcu_req
  26. #define _IOT_ifconf _IOT(_IOTS(struct ifconf),1,0,0,0,0)
  27. +#define __UAPI_DEF_IF_IFCONF 0
  28. +#define __UAPI_DEF_IF_IFMAP 0
  29. +#define __UAPI_DEF_IF_IFNAMSIZ 0
  30. +#define __UAPI_DEF_IF_IFREQ 0
  31. +#define __UAPI_DEF_IF_NET_DEVICE_FLAGS 0
  32. +#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 0
  33. +
  34. #endif
  35. #ifdef __cplusplus
  36. diff --git a/include/netinet/if_ether.h b/include/netinet/if_ether.h
  37. index d9a131aa2d1d..97134d75b480 100644
  38. --- a/include/netinet/if_ether.h
  39. +++ b/include/netinet/if_ether.h
  40. @@ -133,5 +133,6 @@ do { \
  41. (enaddr)[5] = ((uint8_t *)ipaddr)[3]; \
  42. } while(0)
  43. +#define __UAPI_DEF_ETHHDR 0
  44. #endif
  45. diff --git a/include/sys/xattr.h b/include/sys/xattr.h
  46. index 6479fcc62e5f..eeeaafc44f09 100644
  47. --- a/include/sys/xattr.h
  48. +++ b/include/sys/xattr.h
  49. @@ -24,6 +24,8 @@ int removexattr(const char *, const char *);
  50. int lremovexattr(const char *, const char *);
  51. int fremovexattr(int, const char *);
  52. +#define __UAPI_DEF_XATTR 0
  53. +
  54. #ifdef __cplusplus
  55. }
  56. #endif
  57. --
  58. 2.15.1