#include int __pthread_detach(thrd_t t); int thrd_detach(thrd_t t) { /* In the best of all worlds this is a tail call. */ int ret = __pthread_detach(t); if (thrd_success) return ret ? thrd_error : thrd_success; return ret; }