pthread_tag_np() — Set and query thread tag data
Standards
Standards / Extensions | C or C++ | Dependencies |
---|---|---|
z/OS® UNIX | both |
Format
#define _OPEN_THREADS
#include <pthread.h>
int pthread_tag_np(const char *newtag, char *oldtag);
General description
The pthread_tag_np() function is used to set and query the contents of the calling thread's tag data.
The parameters supported are:
- newtag
- Specifies the new tag data to be set for the callers thread. The length of the new tag data must be in the range of 0-65 bytes. If the length is zero (NULL string) the caller's thread tag data will be cleared.
- oldtag
- Specifies the string where pthread_tag_np() returns the old (current) tag data for the caller's thread. Tag data can be up to 66 bytes (including the trailing NULL).
Returned value
If successful, pthread_tag_np() returns 0.
If unsuccessful, pthread_tag_np() returns -1 and sets errno to
one of the following values:
- Error Code
- Description
- EFAULT
- One of the following errors was detected:
- All or part of the newtag string is not addressable by the caller.
- All or part of the oldtag string is not addressable by the caller.
- EINVAL
- The length of the newtag string is not within allowable range (0 to 65 bytes).
- EMVSERR
- An MVS™ environmental or internal error has occurred.