NAME
pthread_attr_getname_np
,
pthread_attr_setname_np
—
get and set descriptive name of an
attribute
LIBRARY
library “libpthread”
SYNOPSIS
#include
<pthread.h>
int
pthread_attr_getname_np
(const
pthread_attr_t attr, char
*name, size_t
len);
int
pthread_attr_setname_np
(pthread_attr_t
attr, const char
*name, void
*arg);
DESCRIPTION
Thepthread_attr_getname_np
()
function gets the descriptive name of a thread attribute. It takes the
following arguments:
- attr
- The attribute whose descriptive name will be obtained.
- name
- The buffer to be filled with the descriptive name of the attribute.
- len
- The size of the buffer name in bytes.
The
pthread_attr_setname_np
()
function sets the descriptive name of a thread attribute. It takes the
following arguments:
RETURN VALUES
Both functions return 0 on success. Otherwise, an error number is returned.
COMPATIBILITY
Both functions are non-standard extensions.
ERRORS
No errors are defined for
pthread_attr_getname_np
().
The pthread_attr_setname_np
() function may
fail if:
- [
EINVAL
] - The supplied descriptive name was longer than
PTHREAD_MAX_NAMELEN_NP
. - [
ENOMEM
] - There was insufficient memory for the operation.