xref: /illumos-gate/usr/src/man/man3proc/proc_get_priv.3proc (revision 2a6e99a0f1f7d22c0396e8b2ce9b9babbd1056cf)
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 PROC_GET_PRIV 3PROC
16.Os
17.Sh NAME
18.Nm proc_get_priv ,
19.Nm proc_free_priv
20.Nd get process privileges
21.Sh SYNOPSIS
22.Lb libproc
23.In libproc.h
24.Ft "prpriv_t *"
25.Fo proc_get_priv
26.Fa "pid_t pid"
27.Fc
28.Ft void
29.Fo proc_free_priv
30.Fa "prpriv_t *prp"
31.Fc
32.Sh DESCRIPTION
33The
34.Fn proc_get_priv
35function is a convenient way to read the /proc privilege file for the
36process
37.Fa pid .
38The
39.Fn proc_get_priv
40function takes care of allocating memory for the privilege set and
41ensures that it is large enough to hold all of the privilege sets.
42The definition of the
43.Sy prpriv_t
44structure may be found in
45.Xr proc 4 .
46.Pp
47The
48.Fn proc_free_priv
49function releases the memory that was allocated by a call to
50.Fn proc_get_priv .
51It is safe to pass the
52.Dv NULL
53pointer in as
54.Fa prp ,
55the function will simply return without taking any action in that case.
56.Sh RETURN VALUES
57Upon successful completion, the
58.Fn proc_get_priv
59function returns a pointer to an allocated
60.Sy prpriv_t
61with the privileges of
62.Fa pid .
63Otherwise,
64.Dv NULL
65is returned to indicate an error occurred.
66.Sh INTERFACE STABILITY
67.Sy Uncommitted
68.Sh MT-LEVEL
69.Sy MT-Safe
70.Sh SEE ALSO
71.Xr libproc 3LIB ,
72.Xr proc 4
73