thr_set_name2
Set user-visible thread name
Usage
#include <sys/thr.h>
int
thr_set_name(long id, const char *name);
Library
Standard C Library (libc, -lc)
Overview
The thr_set_name() system call sets the user-visible name for the thread with the identifier id in the current process to the NUL-terminated string name. The name will be silently truncated to fit into a buffer of MAXCOMLEN + 1 bytes. The thread name can be seen in the output of the ps(1) and top(1) commands, in the kernel debuggers and kernel tracing facility outputs, and in userland debuggers and program core files, as notes.
Return values
If successful, thr_set_name() returns zero; otherwise, -1 is returned, and errno is set to indicate the error.
Errors
The thr_set_name() system call may return the following errors:
- [EFAULT]
-
The memory pointed to by the name argument is not valid.
- [ESRCH]
-
The thread with the identifier id does not exist in the current process.
Releases
25 releases since FreeBSD 11.0-RELEASE; the text changed 12 times.