Multithreaded Programming Guide

Return Values

pthread_detach() returns a zero when it completes successfully. Any other returned value indicates that an error occurred. When any of the following conditions are detected, pthread_detach() fails and returns the corresponding value.


EINVAL

tid is not a valid thread.


ESRCH

tid is not a valid, undetached thread in the current process.