ltrace-0.6.0-events.patch 1.4 KB

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