#include <sys/lwp.h>int _lwp_detach(lwpid_t target_lwp);
The _lwp_detach() function marks the LWP specified by target_lwp as being a detached LWP. The effect is the same as if target_lwp had been created using the LWP_DETACHED flag (see _lwp_create(2)).
The target_lwp must be a non-detached LWP within the same process as the calling LWP.
Upon successful completion, 0 is returned. A non-zero value indicates an error.
If any of the following conditions occur, _lwp_detach() fails and returns the corresponding value:
The LWP with the ID specified by target_lwp is already detached.
No LWP with the ID specified by target_lwp can be found in the current process.
See attributes(5) for descriptions of the following attributes:
|ATTRIBUTE TYPE||ATTRIBUTE VALUE|