2 * This file is part of ltrace.
3 * Copyright (C) 2012 Petr Machata, Red Hat Inc.
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of the
8 * License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 #ifndef _TRACE_DEFS_H_
21 #define _TRACE_DEFS_H_
22 #include <sys/ptrace.h>
24 /* If the system headers did not provide the constants, hard-code the
26 #ifndef PTRACE_OLDSETOPTIONS
27 # define PTRACE_OLDSETOPTIONS 21
30 #ifndef PTRACE_SETOPTIONS
31 # define PTRACE_SETOPTIONS 0x4200
34 #ifndef PTRACE_GETEVENTMSG
35 # define PTRACE_GETEVENTMSG 0x4201
38 /* Options set using PTRACE_SETOPTIONS. */
39 #ifndef PTRACE_O_TRACESYSGOOD
40 # define PTRACE_O_TRACESYSGOOD 0x00000001
43 #ifndef PTRACE_O_TRACEFORK
44 # define PTRACE_O_TRACEFORK 0x00000002
47 #ifndef PTRACE_O_TRACEVFORK
48 # define PTRACE_O_TRACEVFORK 0x00000004
51 #ifndef PTRACE_O_TRACECLONE
52 # define PTRACE_O_TRACECLONE 0x00000008
55 #ifndef PTRACE_O_TRACEEXEC
56 # define PTRACE_O_TRACEEXEC 0x00000010
59 #ifndef PTRACE_O_TRACEVFORKDONE
60 # define PTRACE_O_TRACEVFORKDONE 0x00000020
63 #ifndef PTRACE_O_TRACEEXIT
64 # define PTRACE_O_TRACEEXIT 0x00000040
67 /* Wait extended result codes for the above trace options. */
68 #ifndef PTRACE_EVENT_FORK
69 # define PTRACE_EVENT_FORK 1
72 #ifndef PTRACE_EVENT_VFORK
73 # define PTRACE_EVENT_VFORK 2
76 #ifndef PTRACE_EVENT_CLONE
77 # define PTRACE_EVENT_CLONE 3
80 #ifndef PTRACE_EVENT_EXEC
81 # define PTRACE_EVENT_EXEC 4
84 #ifndef PTRACE_EVENT_VFORK_DONE
85 # define PTRACE_EVENT_VFORK_DONE 5
88 #ifndef PTRACE_EVENT_EXIT
89 # define PTRACE_EVENT_EXIT 6
92 #endif /* _TRACE_DEFS_H_ */