xref: /illumos-gate/usr/src/man/man3proc/proc_get_lwpsinfo.3proc (revision ddb365bfc9e868ad24ccdcb0dc91af18b10df082)
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 2021 Oxide Computer Company
13.\"
14.Dd October 3, 2021
15.Dt PROC_GET_LWPSINFO 3PROC
16.Os
17.Sh NAME
18.Nm proc_get_lwpsinfo
19.Nd get thread ps information
20.Sh SYNOPSIS
21.Lb libproc
22.In libproc
23.Ft int
24.Fo proc_get_lwpsinfo
25.Fa "pid_t pid"
26.Fa "uint_t thr"
27.Fa "lwpsinfo_t *lwp"
28.Fc
29.Sh DESCRIPTION
30The
31.Fn proc_get_lwpsinfo
32function is a convenient way to read the /proc lwpsinfo for the specific
33thread,
34.Fa thr ,
35found in the process
36.Fa pid .
37The information from the
38.Pa lwpsinfo
39file will be placed in
40.Fa lwp .
41The definition of the
42.Vt lwpsinfo_t
43structure may be found in
44.Xr proc 5 .
45.Pp
46The thread identifier for a thread is the same between POSIX pthreads,
47C11 threads, and the native threads API.
48It is safe to pass one of those identifiers in as
49.Fa thr
50or to use a specific number.
51.Sh RETURN VALUES
52Upon successful completion, the
53.Fn proc_get_psinfo
54function returns
55.Sy 0 .
56Otherwise,
57.Sy -1
58is returned to indicate an error occurred.
59.Sh INTERFACE STABILITY
60.Sy Uncommitted
61.Sh MT-LEVEL
62.Sy MT-Safe
63.Sh SEE ALSO
64.Xr libproc 3LIB ,
65.Xr proc 5
66