usched: Allow process to change self cpu affinity
[dragonfly.git] / test / testcases / mem / mmap_1 / mmap_1.c
blobb10503718c9c84ca43d02d9f77e8e511e9b68a34
1 /* Testcase for issue1343 */
2 #include <stdio.h>
3 #include <stdlib.h>
4 #include <pthread.h>
5 #include <sys/types.h>
6 #include <dirent.h>
7 #include <errno.h>
8 #include <unistd.h>
12 void* tester(void *arg)
14 sleep(2);
17 int main(int argc, char *argv[])
19 int i, ret, nthreads;
20 pthread_t th;
21 pthread_t *threads;
23 if (argc <= 1)
25 printf("Need one argument\n");
26 exit(1);
29 nthreads = atoi(argv[1]);
30 threads = malloc(nthreads * sizeof(pthread_t));
31 if (threads == NULL)
32 return 2;
34 printf("Trying with %d threads\n", nthreads);
36 printf("Creating tester threads\n");
37 for (i = 0; i < nthreads; i++)
38 pthread_create(&threads[i], NULL, tester, NULL);
40 sleep(5);
42 printf("Starting join procedure...\n");
43 for (i = 0; i < nthreads; i++)
44 pthread_join(threads[i], NULL);
46 printf("Done!\n");
47 return 0;