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