f3699a1b28fc7bc17cbd4a68d3c4ab4695ea9f7e
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / ltrace / 0001-events.patch
1 [PATCH] events.c: add similar system headers workaround as trace.c
2
3 Needed for E.G. powerpc on uClibc.
4
5 Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
6 ---
7  sysdeps/linux-gnu/events.c |   27 +++++++++++++++++++++++++++
8  1 file changed, 27 insertions(+)
9
10 Index: ltrace-0.6.0/sysdeps/linux-gnu/events.c
11 ===================================================================
12 --- ltrace-0.6.0.orig/sysdeps/linux-gnu/events.c
13 +++ ltrace-0.6.0/sysdeps/linux-gnu/events.c
14 @@ -11,6 +11,33 @@
15  
16  #include "common.h"
17  
18 +/* If the system headers did not provide the constants, hard-code the normal
19 +   values.  */
20 +#ifndef PTRACE_EVENT_FORK
21 +
22 +#define PTRACE_OLDSETOPTIONS    21
23 +#define PTRACE_SETOPTIONS       0x4200
24 +#define PTRACE_GETEVENTMSG      0x4201
25 +
26 +/* options set using PTRACE_SETOPTIONS */
27 +#define PTRACE_O_TRACESYSGOOD   0x00000001
28 +#define PTRACE_O_TRACEFORK      0x00000002
29 +#define PTRACE_O_TRACEVFORK     0x00000004
30 +#define PTRACE_O_TRACECLONE     0x00000008
31 +#define PTRACE_O_TRACEEXEC      0x00000010
32 +#define PTRACE_O_TRACEVFORKDONE 0x00000020
33 +#define PTRACE_O_TRACEEXIT      0x00000040
34 +
35 +/* Wait extended result codes for the above trace options.  */
36 +#define PTRACE_EVENT_FORK       1
37 +#define PTRACE_EVENT_VFORK      2
38 +#define PTRACE_EVENT_CLONE      3
39 +#define PTRACE_EVENT_EXEC       4
40 +#define PTRACE_EVENT_VFORK_DONE 5
41 +#define PTRACE_EVENT_EXIT       6
42 +
43 +#endif /* PTRACE_EVENT_FORK */
44 +
45  static Event event;
46  
47  Event *