2 * Copyright (C) 2009 Pierre-Marc Fournier
3 * Copyright (C) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
5 * SPDX-License-Identifier: LGPL-2.1-only
11 #include <sys/types.h>
15 #define TRACEPOINT_DEFINE
16 #define TRACEPOINT_CREATE_PROBES
17 #include "ust_tests_fork.h"
19 int main(int argc
, char **argv
, char *env
[])
24 fprintf(stderr
, "usage: fork PROG_TO_EXEC\n");
28 printf("parent_pid %d\n", getpid());
29 tracepoint(ust_tests_fork
, before_fork
, getpid());
37 char *args
[] = { (char *) "fork2", NULL
};
39 tracepoint(ust_tests_fork
, after_fork_child
, getpid());
41 result
= execve(argv
[1], args
, env
);
48 printf("child_pid %d\n", result
);
49 tracepoint(ust_tests_fork
, after_fork_parent
, getpid());
50 if (waitpid(result
, NULL
, 0) < 0) {
This page took 0.031116 seconds and 5 git commands to generate.