headers/bsd: Add sys/queue.h.
[haiku.git] / src / tests / system / libroot / posix / user_thread_fork_test.cpp
blob980b0976cdf1622690a86db5ed0d0c1339d64946
1 #include <errno.h>
2 #include <stdio.h>
3 #include <stdlib.h>
4 #include <string.h>
5 #include <unistd.h>
7 #include <OS.h>
9 #include "user_thread.h"
11 int
12 main()
14 pid_t child = fork();
15 if (child < 0) {
16 fprintf(stderr, "Error: fork() failed: %s\n", strerror(errno));
17 exit(1);
20 if (child > 0) {
21 // the parent process -- wait for the child to finish
22 status_t result;
23 wait_for_thread(child, &result);
26 struct user_thread *t = get_user_thread();
27 printf("defer_signals: %" B_PRId32 "\n", t->defer_signals);
29 return 0;