100-musl_fix.patch 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. --- a/net.c
  2. +++ b/net.c
  3. @@ -50,11 +50,7 @@
  4. #include <arpa/inet.h>
  5. #include <net/if.h>
  6. #include <asm/types.h>
  7. -#if defined(__GLIBC__)
  8. -# include <netipx/ipx.h>
  9. -#else
  10. -# include <linux/ipx.h>
  11. -#endif
  12. +#include <linux/ipx.h>
  13. #if defined(__GLIBC__) && defined(HAVE_SIN6_SCOPE_ID_LINUX)
  14. # if defined(HAVE_LINUX_IN6_H)
  15. @@ -94,14 +90,6 @@
  16. # define PF_UNSPEC AF_UNSPEC
  17. #endif
  18. -/* Under Linux these are enums so we can't test for them with ifdef. */
  19. -#define IPPROTO_EGP IPPROTO_EGP
  20. -#define IPPROTO_PUP IPPROTO_PUP
  21. -#define IPPROTO_IDP IPPROTO_IDP
  22. -#define IPPROTO_IGMP IPPROTO_IGMP
  23. -#define IPPROTO_RAW IPPROTO_RAW
  24. -#define IPPROTO_MAX IPPROTO_MAX
  25. -
  26. static const struct xlat domains[] = {
  27. #ifdef PF_UNSPEC
  28. { PF_UNSPEC, "PF_UNSPEC" },
  29. @@ -493,24 +481,16 @@ static const struct xlat protocols[] = {
  30. { IPPROTO_ICMP, "IPPROTO_ICMP" },
  31. { IPPROTO_TCP, "IPPROTO_TCP" },
  32. { IPPROTO_UDP, "IPPROTO_UDP" },
  33. -#ifdef IPPROTO_IGMP
  34. { IPPROTO_IGMP, "IPPROTO_IGMP" },
  35. -#endif
  36. #ifdef IPPROTO_GGP
  37. { IPPROTO_GGP, "IPPROTO_GGP" },
  38. #endif
  39. #ifdef IPPROTO_IPIP
  40. { IPPROTO_IPIP, "IPPROTO_IPIP" },
  41. #endif
  42. -#ifdef IPPROTO_EGP
  43. { IPPROTO_EGP, "IPPROTO_EGP" },
  44. -#endif
  45. -#ifdef IPPROTO_PUP
  46. { IPPROTO_PUP, "IPPROTO_PUP" },
  47. -#endif
  48. -#ifdef IPPROTO_IDP
  49. { IPPROTO_IDP, "IPPROTO_IDP" },
  50. -#endif
  51. #ifdef IPPROTO_TP
  52. { IPPROTO_TP, "IPPROTO_TP" },
  53. #endif
  54. @@ -571,12 +551,8 @@ static const struct xlat protocols[] = {
  55. #ifdef IPPROTO_UDPLITE
  56. { IPPROTO_UDPLITE, "IPPROTO_UDPLITE" },
  57. #endif
  58. -#ifdef IPPROTO_RAW
  59. { IPPROTO_RAW, "IPPROTO_RAW" },
  60. -#endif
  61. -#ifdef IPPROTO_MAX
  62. { IPPROTO_MAX, "IPPROTO_MAX" },
  63. -#endif
  64. { 0, NULL },
  65. };
  66. static const struct xlat msg_flags[] = {
  67. --- a/process.c
  68. +++ b/process.c
  69. @@ -55,19 +55,6 @@
  70. # endif
  71. #endif
  72. -#ifdef HAVE_LINUX_PTRACE_H
  73. -# undef PTRACE_SYSCALL
  74. -# ifdef HAVE_STRUCT_IA64_FPREG
  75. -# define ia64_fpreg XXX_ia64_fpreg
  76. -# endif
  77. -# ifdef HAVE_STRUCT_PT_ALL_USER_REGS
  78. -# define pt_all_user_regs XXX_pt_all_user_regs
  79. -# endif
  80. -# include <linux/ptrace.h>
  81. -# undef ia64_fpreg
  82. -# undef pt_all_user_regs
  83. -#endif
  84. -
  85. #if defined(SPARC64)
  86. # define r_pc r_tpc
  87. # undef PTRACE_GETREGS
  88. @@ -94,6 +81,7 @@
  89. #include <sched.h>
  90. #include <asm/posix_types.h>
  91. +#include <asm/ptrace.h>
  92. #undef GETGROUPS_T
  93. #define GETGROUPS_T __kernel_gid_t
  94. #undef GETGROUPS32_T
  95. @@ -2857,7 +2845,7 @@ sys_sched_setscheduler(struct tcb *tcp)
  96. if (umove(tcp, tcp->u_arg[2], &p) < 0)
  97. tprintf(", %#lx", tcp->u_arg[2]);
  98. else
  99. - tprintf(", { %d }", p.__sched_priority);
  100. + tprintf(", { %d }", p.sched_priority);
  101. }
  102. return 0;
  103. }
  104. @@ -2872,7 +2860,7 @@ sys_sched_getparam(struct tcb *tcp)
  105. if (umove(tcp, tcp->u_arg[1], &p) < 0)
  106. tprintf("%#lx", tcp->u_arg[1]);
  107. else
  108. - tprintf("{ %d }", p.__sched_priority);
  109. + tprintf("{ %d }", p.sched_priority);
  110. }
  111. return 0;
  112. }
  113. @@ -2885,7 +2873,7 @@ sys_sched_setparam(struct tcb *tcp)
  114. if (umove(tcp, tcp->u_arg[1], &p) < 0)
  115. tprintf("%d, %#lx", (int) tcp->u_arg[0], tcp->u_arg[1]);
  116. else
  117. - tprintf("%d, { %d }", (int) tcp->u_arg[0], p.__sched_priority);
  118. + tprintf("%d, { %d }", (int) tcp->u_arg[0], p.sched_priority);
  119. }
  120. return 0;
  121. }
  122. --- a/signal.c
  123. +++ b/signal.c
  124. @@ -35,6 +35,7 @@
  125. #include <sys/user.h>
  126. #include <fcntl.h>
  127. +#include <asm/ptrace.h>
  128. #ifdef HAVE_SYS_REG_H
  129. # include <sys/reg.h>
  130. # ifndef PTRACE_PEEKUSR
  131. --- a/time.c
  132. +++ b/time.c
  133. @@ -774,7 +774,7 @@ printsigevent(struct tcb *tcp, long arg)
  134. /* _pad[0] is the _tid field which might not be
  135. present in the userlevel definition of the
  136. struct. */
  137. - tprintf("{%d}", sev._sigev_un._pad[0]);
  138. + tprintf("{%d}", *(int *) &sev.sigev_notify_function);
  139. else if (sev.sigev_notify == SIGEV_THREAD)
  140. tprintf("{%p, %p}", sev.sigev_notify_function,
  141. sev.sigev_notify_attributes);
  142. --- a/defs.h
  143. +++ b/defs.h
  144. @@ -27,6 +27,7 @@
  145. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  146. */
  147. +#define _LARGEFILE64_SOURCE 1
  148. #ifdef HAVE_CONFIG_H
  149. # include "config.h"
  150. #endif
  151. @@ -222,7 +223,7 @@ extern long ptrace(int, int, char *, lon
  152. # define PTRACE_EVENT_EXIT 6
  153. #endif
  154. -#if !defined(__GLIBC__)
  155. +#if !defined(__GLIBC__) && !defined(PTRACE_PEEKUSER)
  156. # define PTRACE_PEEKUSER PTRACE_PEEKUSR
  157. # define PTRACE_POKEUSER PTRACE_POKEUSR
  158. #endif