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

Plwp_getpsinfo
get thread specific ps information

Process Control Library (libproc, -lproc)

#include <libproc.h>
int
Plwp_getpsinfo(struct ps_prochandle *P, lwpid_t lwpid, lwpsinfo_t *lps);

The Plwp_getpsinfo() function looks up the thread-specific ps(1) information for the thread specified by lwpid in the process handle P. The caller should provide a pointer to an lwpsinfo_t, lps, whose definition can be found in proc(4). lps will be filled in with information such as the thread's id, its current state, priority, and run-time.
The Plwp_getpsinfo() 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.

Upon successful completion, the Plwp_getpsinfo() function returns 0 and lps is filled in with the thread-specific ps(1) information. Otherwise, -1 is returned and errno is set to indicate the error.

For a full list of possible errors also see the DIAGNOSTICS section in proc(4).
The Plwp_getpsinfo() function will fail if:
 
 
P refers to a file handle obtained through Pgrab_file(3PROC).
 
 
The process handle P refers to a core file and the specified thread does not exist.
 
 
The process handle P refers to an active process and the specified thread does not exist.

Uncommitted

See LOCKING in ps(1), libproc(3LIB).

libproc(3LIB), proc(4)
May 11, 2016 illumos