aboutsummaryrefslogtreecommitdiffstats
path: root/common.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2020-05-30 21:48:41 +0200
committerMattias Andrée <maandree@kth.se>2020-05-30 21:48:41 +0200
commit261293d374570ee90def87fc5f503cbccb0c6a6c (patch)
tree826f7e209723051e76b11096d44c97c5e9a0dbc8 /common.h
parentAdd support for tracing fork children (diff)
downloadsctrace-261293d374570ee90def87fc5f503cbccb0c6a6c.tar.gz
sctrace-261293d374570ee90def87fc5f503cbccb0c6a6c.tar.bz2
sctrace-261293d374570ee90def87fc5f503cbccb0c6a6c.tar.xz
m + add support for tracing vfork children
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'common.h')
-rw-r--r--common.h30
1 files changed, 28 insertions, 2 deletions
diff --git a/common.h b/common.h
index f027327..376e0f9 100644
--- a/common.h
+++ b/common.h
@@ -28,6 +28,24 @@
#include "list-errnos.h"
+#ifndef ERESTARTSYS
+# define ERESTARTSYS 512
+# define ALSO_ERESTARTSYS
+#endif
+#ifndef ERESTARTNOINTR
+# define ERESTARTNOINTR 513
+# define ALSO_ERESTARTNOINTR
+#endif
+#ifndef ERESTARTNOHAND
+# define ERESTARTNOHAND 514
+# define ALSO_ERESTARTNOHAND
+#endif
+#ifndef ERESTART_RESTARTBLOCK
+# define ERESTART_RESTARTBLOCK 516
+# define ALSO_ERESTART_RESTARTBLOCK
+#endif
+
+
enum type {
Unknown,
Void,
@@ -48,7 +66,11 @@ enum type {
enum state {
Normal,
- Syscall
+ Syscall,
+ ForkChild,
+ VforkChild,
+ ForkParent,
+ VforkParent
};
struct process {
@@ -62,6 +84,10 @@ struct process {
unsigned long long int args[6];
unsigned long long int ret;
enum type ret_type;
+
+ /* vfork(2) data */
+ struct process *continue_on_exit;
+ struct process *vfork_waiting_on;
};
@@ -81,7 +107,7 @@ void print_systemcall_exit(struct process *proc);
/* process.c */
void init_process_list(void);
struct process *find_process(pid_t pid);
-struct process *add_process(pid_t pid, int trace_options);
+struct process *add_process(pid_t pid, unsigned long int trace_options);
void remove_process(struct process *proc);
/* util.c */