use direct syscall rather than write function in posix_spawn child
[musl] / src / thread / pthread_join.c
1 #include "pthread_impl.h"
2 #include <sys/mman.h>
3
4 int __munmap(void *, size_t);
5
6 static void dummy(void *p)
7 {
8 }
9
10 int __pthread_join(pthread_t t, void **res)
11 {
12         int tmp;
13         pthread_testcancel();
14         while ((tmp = t->tid)) __timedwait(&t->tid, tmp, 0, 0, dummy, 0, 0);
15         if (res) *res = t->result;
16         if (t->map_base) __munmap(t->map_base, t->map_size);
17         return 0;
18 }
19
20 weak_alias(__pthread_join, pthread_join);