1 /* Test handle_group_exit() handling of a thread leader still alive with its
2 * thread child calling exit_group() and proper passing of the process exit
3 * code to the process parent of this whole thread group.
5 * gcc -o test/leaderkill test/leaderkill.c -Wall -ggdb2 -pthread;./test/leaderkill & pid=$!;sleep 1;strace -o x -q ./strace -f -p $pid
6 * It must print: write(1, "OK\n", ...
16 static void *start0(void *arg)
22 static void *start1(void *arg)
29 int main(int argc, char *argv[])
45 i = pthread_create(&thread0, NULL, start0, NULL);
47 i = pthread_create(&thread1, NULL, start1, NULL);
54 got_pid = waitpid(child, &status, 0);
55 assert(got_pid == child);
56 assert(WIFEXITED(status));
57 assert(WEXITSTATUS(status) == 42);