6 #include <process/process.h>
7 #include <waiter/waiter.h>
8 #include <talloc/talloc.h>
10 static int do_child(void)
15 int main(int argc, char **argv)
17 struct waitset *waitset;
18 struct process *process;
19 const char *child_argv[3];
22 if (argc == 2 && !strcmp(argv[1], "child"))
25 ctx = talloc_new(NULL);
27 waitset = waitset_create(ctx);
29 process_init(ctx, waitset, false);
31 child_argv[0] = argv[0];
32 child_argv[1] = "child";
35 process = process_create(ctx);
36 process->path = child_argv[0];
37 process->argv = child_argv;
39 process_run_sync(process);
41 assert(WIFEXITED(process->exit_status));
42 assert(WEXITSTATUS(process->exit_status) == 42);