1 PLWP_GETNAME(3PROC) Process Control Library Functions PLWP_GETNAME(3PROC) 2 3 NAME 4 Plwp_getname - get thread name 5 6 LIBRARY 7 Process Control Library (libproc, -lproc) 8 9 SYNOPSIS 10 #include <libproc.h> 11 12 int 13 Plwp_getname(struct ps_prochandle *P, lwpid_t lwpid, char *buf, 14 size_t bufsize); 15 16 DESCRIPTION 17 The Plwp_getname() function returns the thread name in the supplied 18 buffer, from the thread lwpid in the process handle P. 19 20 If no thread name is set, the buffer is set to the empty string. The 21 buffer should be at least THREAD_NAME_MAX in size. 22 23 The Plwp_getname() function only works on process handles that refer to 24 active processes and core files, it does not work on process handles that 25 refer to individual files. 26 27 RETURN VALUES 28 Upon successful completion, the Plwp_getname() function returns 0. 29 Otherwise, -1 is returned, errno is set to indicate the error. The 30 buffer may be modified even if an error is returned. 31 32 ERRORS 33 For a full list of possible errors also see the DIAGNOSTICS section in 34 proc(4). 35 36 The Plwp_getname() function will fail if: 37 38 ENODATA P refers to a file handle obtained through 39 Pgrab_file(3PROC). 40 41 EINVAL The process handle P refers to a core file and the 42 specified thread does not exist. 43 44 ENOENT The process handle P refers to an active process and 45 the specified thread does not exist. P 46 47 ENAMETOOLONG The buffer is not sufficient to hold the thread name. 48 49 INTERFACE STABILITY 50 Uncommitted 51 52 MT-LEVEL 53 See LOCKING in libproc(3LIB). 54 55 SEE ALSO 56 libproc(3LIB), proc(4) 57 58 illumos August 31, 2018 illumos