xref: /illumos-gate/usr/src/man/man3proc/proc_get_status.3proc (revision 92101ea43dccf9afc9af34c02a30de381d3fe66a)
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 November 27, 2023
15.Dt PROC_GET_STATUS 3PROC
16.Os
17.Sh NAME
18.Nm proc_get_status
19.Nd get process status information
20.Sh LIBRARY
21.Lb libproc
22.Sh SYNOPSIS
23.In libproc.h
24.Ft int
25.Fo proc_get_status
26.Fa "pid_t pid"
27.Fa "pstatus_t *psp"
28.Fc
29.Sh DESCRIPTION
30The
31.Fn proc_get_status
32function is a convenient way to read the /proc status file for the
33process
34.Fa pid .
35The status information of the process will be filled into
36.Fa psp .
37The definition of the
38.Sy pstatus_t
39structure may be found in
40.Xr proc 5 .
41.Sh RETURN VALUES
42Upon successful completion, the
43.Fn proc_get_status
44function returns
45.Sy 0 .
46Otherwise,
47.Sy -1
48is returned to indicate an error occurred.
49.Sh INTERFACE STABILITY
50.Sy Uncommitted
51.Sh MT-LEVEL
52.Sy MT-Safe
53.Sh SEE ALSO
54.Xr libproc 3LIB ,
55.Xr proc 5
56