|Reported by:||cocobean||Owned by:||nobody|
|Has a Patch:||no||Platform:||All|
Provide kernel support of pthread_setname_np and pthread_getname_np - set/get the name of a thread.
By default, all the threads created using pthread_create() inherit the program name. The pthread_setname_np() function can be used to set a unique name for a thread, which can be useful for debugging multithreaded applications. The thread name is a meaningful C language string, whose length is restricted to 16 characters, including the terminating null byte ('\0'). The thread argument specifies the thread whose name is to be changed; name specifies the new name.
The pthread_getname_np() function can be used to retrieve the name of the thread. The thread argument specifies the thread whose name is to be retrieved. The buffer name is used to return the thread name; len specifies the number of bytes available in name. The buffer specified by name should be at least 16 characters in length. The returned thread name in the output buffer will be null terminated.
On success, these functions return 0; on error, they return a nonzero error number.