memcheck/tests/sh-mem-random.c: Set huge_addr to 240GB
[valgrind.git] / drd / tests / pth_detached3.c
blobeab8514ede074244b9b68409cb016113576f4501
1 /* Invoke pthread_detach() with an invalid thread ID. */
3 #include <assert.h>
4 #include <errno.h>
5 #include <pthread.h>
6 #include <stdio.h>
7 #include <stdint.h>
9 #if defined(VGO_freebsd)
10 #include <sys/types.h>
11 #endif
13 static void* thread_func(void* arg)
15 return 0;
18 int main(int argc, char** argv)
20 pthread_t thread;
22 pthread_create(&thread, NULL, thread_func, NULL);
23 pthread_join(thread, NULL);
25 /* Invoke pthread_detach() with the thread ID of a joined thread. */
26 pthread_detach(thread);
28 /* Invoke pthread_detach() with an invalid thread ID. */
29 #ifdef VGO_freebsd
30 pthread_detach((pthread_t)12345);
31 #else
32 pthread_detach((pthread_t)((uintptr_t)thread + 8));
33 #endif
35 fprintf(stderr, "Finished.\n");
37 return 0;