| PTHREAD_ATTR_GETNAME_NP(3C) | Standard C Library Functions | PTHREAD_ATTR_GETNAME_NP(3C) |
pthread_attr_getname_np,
pthread_attr_setname_np —
get or set thread name attribute
#include
<pthread.h>
int
pthread_attr_getname_np(pthread_attr_t
*restrict attr, char *name,
size_t len);
int
pthread_attr_setname_np(pthread_attr_t
*restrict attr, const char *name);
The
pthread_attr_setname_np()
and
pthread_attr_getname_np()
functions, respectively, set and get the thread name attribute in
attr to name. For
pthread_attr_getname_np(), len
is the size of name. Any threads created with
pthread_create(3c) using
attr will have their name set to
name upon creation.
Thread names are limited to
PTHREAD_MAX_NAMELEN_NP including the terminating
NUL. They may only contain printable ASCII characters.
Upon successful completion, the
pthread_attr_getname_np() and
pthread_attr_setname_np() functions return
0. Otherwise, an
error number is returned to indicate the error.
The pthread_attr_getname_np() function may
fail with:
EINVALERANGEThe pthread_attr_setname_np() function may
fail with:
ERANGE| August 22, 2018 | OmniOS |