7 void handler(int signo
) {
12 void *ret
= signal(SIGINT
, handler
);
13 assert (ret
!= SIG_ERR
);
15 pid_t child_pid
= fork();
16 assert (child_pid
!= -1);
23 printf("signo = %d\n", SIGCHLD
);
24 printf("code = %d\n", CLD_EXITED
);
25 printf("child_pid = %d\n", child_pid
);
26 printf("uid = %d\n", getuid());
27 pid_t waited
= wait(NULL
);
28 assert(waited
== child_pid
);