xref: /illumos-gate/usr/src/man/man3proc/Plwp_getpsinfo.3proc (revision 2c5ec7a875dcd76853e6618614e990f1e8cdd56d)
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.
64Otherwise,
65.Sy -1
66is returned and
67.Sy errno
68is set to indicate the error.
69.Sh ERRORS
70For a full list of possible errors also see the
71.Sy DIAGNOSTICS
72section in
73.Xr proc 4 .
74.Pp
75The
76.Fn Plwp_getpsinfo
77function will fail if:
78.Bl -tag -width Er
79.It Er ENODATA
80.Fa P
81refers to a file handle obtained through
82.Xr Pgrab_file 3PROC .
83.It Er EINVAL
84The process handle
85.Fa P
86refers to a core file and the specified thread does not exist.
87.It Er ENOENT
88The process handle
89.Fa P
90refers to an active process and the specified thread does not exist.
91.El
92.Sh INTERFACE STABILITY
93.Sy Uncommitted
94.Sh MT-LEVEL
95See
96.Sy LOCKING
97in
98.Xr ps 1 ,
99.Xr libproc 3LIB .
100.Sh SEE ALSO
101.Xr libproc 3LIB ,
102.Xr proc 4
103