PLWP_GETNAME(3PROC) Process Control Library Functions PLWP_GETNAME(3PROC)

NAME


Plwp_getname - get thread name

LIBRARY


Process Control Library (libproc, -lproc)

SYNOPSIS


#include <libproc.h>

int
Plwp_getname(struct ps_prochandle *P, lwpid_t lwpid, char *buf,
size_t bufsize);

DESCRIPTION


The Plwp_getname() function returns the thread name in the supplied buffer,
from the thread lwpid in the process handle P.

If no thread name is set, the buffer is set to the empty string. The
buffer should be at least THREAD_NAME_MAX in size.

The Plwp_getname() function only works on process handles that refer to
active processes and core files, it does not work on process handles that
refer to individual files.

RETURN VALUES


Upon successful completion, the Plwp_getname() function returns 0.
Otherwise, -1 is returned, errno is set to indicate the error. The buffer
may be modified even if an error is returned.

ERRORS


For a full list of possible errors also see the DIAGNOSTICS section in
proc(4).

The Plwp_getname() function will fail if:

ENODATA P refers to a file handle obtained through
Pgrab_file(3PROC).

EINVAL The process handle P refers to a core file and the
specified thread does not exist.

ENOENT The process handle P refers to an active process and the
specified thread does not exist. P

ENAMETOOLONG The buffer is not sufficient to hold the thread name.

INTERFACE STABILITY


Uncommitted

MT-LEVEL
See LOCKING in libproc(3LIB).

SEE ALSO


libproc(3LIB), proc(4)

illumos August 31, 2018 illumos