Retrieve the name of a thread
#include <pthread.h> int pthread_getname_np(pthread_t tid, char* buffer, int buffersize);
- The ID of the thread whose name you want to get, or 0 to get the name of the calling thread.
- A storage place for the name.
- The size of the buffer, in bytes.
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The pthread_getname_np() function retrieves the name of the specified thread as a NULL-terminated string up to a maximum size (as determined by the buffersize). If the thread doesn't have a name, the function stores a NULL-terminated empty string in the buffer. The "np" in the function's name stands for "non-POSIX."
- The name buffer length is invalid or smaller than the new name length.
- You don't have the appropriate permissions to get the name.
Last modified: 2013-12-23