Caution: This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs.

pthread_getname_np()

Retrieve the name of a thread

Synopsis:

#include <pthread.h>

int pthread_getname_np(pthread_t tid,
                       char* buffer,
                       int buffersize);

Arguments:

tid
The ID of the thread whose name you want to get.
buffer
A storage place for the name.
buffersize
The size of the buffer, in bytes.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

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."


Note: This function was added in the QNX Neutrino Core OS 6.3.2.

Returns:

EOK
Success.
E2BIG
The name is larger than the accepted size.
EINVAL
The name buffer length is invalid or smaller that the new name length.
EPERM
The process doesn't have superuser capabilities.

Classification:

QNX Neutrino

Safety:
Cancellation point Yes
Interrupt handler No
Signal handler Yes
Thread Yes

See also:

pthread_setname_np()