summaryrefslogtreecommitdiff
path: root/include/linux/ptrace.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/ptrace.h')
-rw-r--r--include/linux/ptrace.h31
1 files changed, 26 insertions, 5 deletions
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
index 706b420fb5c9..5d44a953f423 100644
--- a/include/linux/ptrace.h
+++ b/include/linux/ptrace.h
@@ -3,8 +3,6 @@
/* ptrace.h */
/* structs and defines to help the user use the ptrace system call. */
-#include <linux/compiler.h>
-
/* has the defines to get at the registers. */
#define PTRACE_TRACEME 0
@@ -38,6 +36,8 @@
#define PTRACE_O_TRACEVFORKDONE 0x00000020
#define PTRACE_O_TRACEEXIT 0x00000040
+#define PTRACE_O_MASK 0x0000007f
+
/* Wait extended result codes for the above trace options. */
#define PTRACE_EVENT_FORK 1
#define PTRACE_EVENT_VFORK 2
@@ -47,7 +47,27 @@
#define PTRACE_EVENT_EXIT 6
#include <asm/ptrace.h>
-#include <linux/sched.h>
+
+#ifdef __KERNEL__
+/*
+ * Ptrace flags
+ */
+
+#define PT_PTRACED 0x00000001
+#define PT_DTRACE 0x00000002 /* delayed trace (used on m68k, i386) */
+#define PT_TRACESYSGOOD 0x00000004
+#define PT_PTRACE_CAP 0x00000008 /* ptracer can follow suid-exec */
+#define PT_TRACE_FORK 0x00000010
+#define PT_TRACE_VFORK 0x00000020
+#define PT_TRACE_CLONE 0x00000040
+#define PT_TRACE_EXEC 0x00000080
+#define PT_TRACE_VFORK_DONE 0x00000100
+#define PT_TRACE_EXIT 0x00000200
+
+#define PT_TRACE_MASK 0x000003f4
+
+#include <linux/compiler.h> /* For unlikely. */
+#include <linux/sched.h> /* For struct task_struct. */
extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char *dst, int len);
extern int ptrace_writedata(struct task_struct *tsk, char * src, unsigned long dst, int len);
@@ -58,11 +78,11 @@ extern int ptrace_check_attach(struct task_struct *task, int kill);
extern int ptrace_request(struct task_struct *child, long request, long addr, long data);
extern void ptrace_notify(int exit_code);
extern void __ptrace_link(struct task_struct *child,
- struct task_struct *new_parent);
+ struct task_struct *new_parent);
extern void __ptrace_unlink(struct task_struct *child);
static inline void ptrace_link(struct task_struct *child,
- struct task_struct *new_parent)
+ struct task_struct *new_parent)
{
if (unlikely(child->ptrace))
__ptrace_link(child, new_parent);
@@ -72,5 +92,6 @@ static inline void ptrace_unlink(struct task_struct *child)
if (unlikely(child->ptrace))
__ptrace_unlink(child);
}
+#endif
#endif