1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/patches/ltrace/0.5.3/160-fix-missing-ptrace-defines.patch Sat Jul 03 00:17:54 2010 +0200
1.3 @@ -0,0 +1,72 @@
1.4 +This patch tries to fix the issue when PTRACE_EVENT_FORK is not found in the standard
1.5 +system headers. The begininngs of this was already in place in trace.c, this patch
1.6 +only takes that idea and puts it in a shared include file for trace.c *and* events.c.
1.7 +The latter of which otherwise fails to build on Arm.
1.8 +
1.9 + Joachim Nilsson <jocke@vmlinux.org>
1.10 +
1.11 +diff -ruN ltrace-0.5.3.orig/sysdeps/linux-gnu/events.c ltrace-0.5.3/sysdeps/linux-gnu/events.c
1.12 +--- ltrace-0.5.3.orig/sysdeps/linux-gnu/events.c 2009-07-25 17:13:02.000000000 +0200
1.13 ++++ ltrace-0.5.3/sysdeps/linux-gnu/events.c 2010-01-03 14:33:46.000000000 +0100
1.14 +@@ -7,9 +7,8 @@
1.15 + #include <errno.h>
1.16 + #include <signal.h>
1.17 + #include <string.h>
1.18 +-#include <sys/ptrace.h>
1.19 +
1.20 +-#include "common.h"
1.21 ++#include "trace.h"
1.22 +
1.23 + static Event event;
1.24 +
1.25 +diff -ruN ltrace-0.5.3.orig/sysdeps/linux-gnu/trace.c ltrace-0.5.3/sysdeps/linux-gnu/trace.c
1.26 +--- ltrace-0.5.3.orig/sysdeps/linux-gnu/trace.c 2009-07-25 17:13:02.000000000 +0200
1.27 ++++ ltrace-0.5.3/sysdeps/linux-gnu/trace.c 2010-01-03 14:33:38.000000000 +0100
1.28 +@@ -5,10 +5,9 @@
1.29 + #include <unistd.h>
1.30 + #include <sys/types.h>
1.31 + #include <sys/wait.h>
1.32 +-#include "ptrace.h"
1.33 + #include <asm/unistd.h>
1.34 +
1.35 +-#include "common.h"
1.36 ++#include "trace.h"
1.37 +
1.38 + /* If the system headers did not provide the constants, hard-code the normal
1.39 + values. */
1.40 +diff -ruN ltrace-0.5.3.orig/sysdeps/linux-gnu/trace.h ltrace-0.5.3/sysdeps/linux-gnu/trace.h
1.41 +--- ltrace-0.5.3.orig/sysdeps/linux-gnu/trace.h 1970-01-01 01:00:00.000000000 +0100
1.42 ++++ ltrace-0.5.3/sysdeps/linux-gnu/trace.h 2010-01-03 14:33:26.000000000 +0100
1.43 +@@ -0,0 +1,32 @@
1.44 ++/* If the system headers did not provide the constants, hard-code the normal values. */
1.45 ++#ifndef __SYSDEPS_TRACE_H__
1.46 ++#define __SYSDEPS_TRACE_H__
1.47 ++
1.48 ++#include "ptrace.h"
1.49 ++#include "common.h"
1.50 ++
1.51 ++#ifndef PTRACE_EVENT_FORK
1.52 ++#warning PTRACE_EVENT_FORK not found... redefining.
1.53 ++#define PTRACE_OLDSETOPTIONS 21
1.54 ++#define PTRACE_SETOPTIONS 0x4200
1.55 ++#define PTRACE_GETEVENTMSG 0x4201
1.56 ++
1.57 ++/* options set using PTRACE_SETOPTIONS */
1.58 ++#define PTRACE_O_TRACESYSGOOD 0x00000001
1.59 ++#define PTRACE_O_TRACEFORK 0x00000002
1.60 ++#define PTRACE_O_TRACEVFORK 0x00000004
1.61 ++#define PTRACE_O_TRACECLONE 0x00000008
1.62 ++#define PTRACE_O_TRACEEXEC 0x00000010
1.63 ++#define PTRACE_O_TRACEVFORKDONE 0x00000020
1.64 ++#define PTRACE_O_TRACEEXIT 0x00000040
1.65 ++
1.66 ++/* Wait extended result codes for the above trace options. */
1.67 ++#define PTRACE_EVENT_FORK 1
1.68 ++#define PTRACE_EVENT_VFORK 2
1.69 ++#define PTRACE_EVENT_CLONE 3
1.70 ++#define PTRACE_EVENT_EXEC 4
1.71 ++#define PTRACE_EVENT_VFORK_DONE 5
1.72 ++#define PTRACE_EVENT_EXIT 6
1.73 ++
1.74 ++#endif /* PTRACE_EVENT_FORK */
1.75 ++#endif /* __SYSDEPS_TRACE_H__ */