1.\" 2.\" This file and its contents are supplied under the terms of the 3.\" Common Development and Distribution License ("CDDL"), version 1.0. 4.\" You may only use this file in accordance with the terms of version 5.\" 1.0 of the CDDL. 6.\" 7.\" A full copy of the text of the CDDL should have accompanied this 8.\" source. A copy of the CDDL is also available via the Internet at 9.\" http://www.illumos.org/license/CDDL. 10.\" 11.\" 12.\" Copyright 2015 Joyent, Inc. 13.\" 14.Dd May 11, 2016 15.Dt PLWP_GETPSINFO 3PROC 16.Os 17.Sh NAME 18.Nm Plwp_getpsinfo 19.Nd get thread specific ps information 20.Sh SYNOPSIS 21.Lb libproc 22.In libproc.h 23.Ft int 24.Fo Plwp_getpsinfo 25.Fa "struct ps_prochandle *P" 26.Fa "lwpid_t lwpid" 27.Fa "lwpsinfo_t *lps" 28.Fc 29.Sh DESCRIPTION 30The 31.Fn Plwp_getpsinfo 32function 33looks up the thread-specific 34.Xr ps 1 35information for the thread specified by 36.Fa lwpid 37in the process handle 38.Fa P . 39The caller should provide a pointer to an 40.Sy lwpsinfo_t , 41.Fa lps , 42whose definition can be found in 43.Xr proc 4 . 44.Fa lps 45will be filled in with information such as the thread's id, its current 46state, priority, and run-time. 47.Pp 48The 49.Fn Plwp_getpsinfo 50function only works on process handles that refer to active processes 51and core files, it does not work on process handles that refer to 52individual files. 53.Sh RETURN VALUES 54Upon successful completion, the 55.Fn Plwp_getpsinfo 56function returns 57.Sy 0 58and 59.Fa lps 60is filled in with the 61thread-specific 62.Xr ps 1 63information. Otherwise, 64.Sy -1 65is returned and 66.Sy errno 67is set to indicate the error. 68.Sh ERRORS 69For a full list of possible errors also see the 70.Sy DIAGNOSTICS 71section in 72.Xr proc 4 . 73.Pp 74The 75.Fn Plwp_getpsinfo 76function will fail if: 77.Bl -tag -width Er 78.It Er ENODATA 79.Fa P 80refers to a file handle obtained through 81.Xr Pgrab_file 3PROC . 82.It Er EINVAL 83The process handle 84.Fa P 85refers to a core file and the specified thread does not exist. 86.It Er ENOENT 87The process handle 88.Fa P 89refers to an active process and the specified thread does not exist. 90.El 91.Sh INTERFACE STABILITY 92.Sy Uncommitted 93.Sh MT-LEVEL 94See 95.Sy LOCKING 96in 97.Xr ps 1 , 98.Xr libproc 3LIB . 99.Sh SEE ALSO 100.Xr libproc 3LIB , 101.Xr proc 4 102