Expand PMF_FN_* macros.
[netbsd-mini2440.git] / regress / lib / libpthread / cancel2 / cancel2.c
blob663f7666ae03e02fbbb12c85969c130de48ff255
1 /* $NetBSD$ */
2 #include <stdio.h>
3 #include <stdlib.h>
4 #include <pthread.h>
5 #include <unistd.h>
7 int
8 main(void)
10 char str1[] = "You should see this.\n";
11 char str2[] = "You should not see this.\n";
13 printf("Cancellation test 2: Self-cancellation and disabling.\n");
16 pthread_cancel(pthread_self());
18 pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
20 write(STDOUT_FILENO, str1, sizeof(str1));
22 pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
24 write(STDOUT_FILENO, str2, sizeof(str2));
26 exit(1);