1#include <stdint.h>
2#include <threads.h>
3
4int __pthread_join(thrd_t, void**);
5
6int thrd_join(thrd_t t, int *res)
7{
8        void *pthread_res;
9        __pthread_join(t, &pthread_res);
10        if (res) *res = (int)(intptr_t)pthread_res;
11        return thrd_success;
12}
13