aboutsummaryrefslogtreecommitdiffstats
path: root/common.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2020-05-31 23:22:22 +0200
committerMattias Andrée <maandree@kth.se>2020-05-31 23:22:22 +0200
commitbe1c092cd99a023b3d4178066925b644feb0565f (patch)
treeea5fd38c39aacdc93b55fa8fc9271ad523032f7c /common.h
parentm (diff)
downloadsctrace-be1c092cd99a023b3d4178066925b644feb0565f.tar.gz
sctrace-be1c092cd99a023b3d4178066925b644feb0565f.tar.bz2
sctrace-be1c092cd99a023b3d4178066925b644feb0565f.tar.xz
Tracing fork children does not work
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'common.h')
-rw-r--r--common.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/common.h b/common.h
index 43b3d24..a00bc67 100644
--- a/common.h
+++ b/common.h
@@ -79,10 +79,11 @@ enum state {
struct process {
pid_t pid;
- pid_t thread_group_leader;
+ pid_t thread_leader;
struct process *next;
struct process *prev;
enum state state;
+ int silent_until_execed;
/* Syscall data */
unsigned long long int scall;
@@ -119,4 +120,7 @@ void remove_process(struct process *proc);
/* util.c */
void setup_trace_output(FILE *fp, int multiprocess);
void tprintf(struct process *proc, const char *fmt, ...);
-_Noreturn void eprintf(const char *fmt, ...);
+void weprintf(const char *fmt, ...);
+#define eprintf(...) (weprintf(__VA_ARGS__), exit(1))
+#define eprintf_and_kill(PID, ...) (weprintf(__VA_ARGS__), kill((PID), SIGKILL), exit(1))
+FILE *xfopen(const char *file, const char *mode);