xref: /illumos-gate/usr/src/man/man3proc/pr_setrctl.3proc (revision 20a7641f9918de8574b8b3b47dbe35c4bfc78df1)
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 PR_SETRCTL 3PROC
16.Os
17.Sh NAME
18.Nm pr_setrctl
19.Nd inject setrctl system call into victim process
20.Sh SYNOPSIS
21.Lb libproc
22.In libproc.h
23.Ft int
24.Fo pr_setrctl
25.Fa "struct ps_prochandle *P"
26.Fa "const char *rname"
27.Fa "rctlblk_t *old_blk"
28.Fa "rctlblk_t *new_blk"
29.Fa "int rflag"
30.Fc
31.Sh DESCRIPTION
32The
33.Fn pr_setrctl
34function injects the
35.Xr setrctl 2
36system call into the target process
37.Fa P
38by means of the agent LWP.
39If the process handle
40.Fa P
41is the value
42.Dv NULL
43then this will be equivalent to calling
44.Xr setrctl 2
45on the currently running process.
46.Pp
47The arguments
48.Fa rname ,
49.Fa old_blk ,
50.Fa new_blk ,
51and
52.Fa rflag
53have the same meaning as in
54.Xr setrctl 2 .
55See
56.Xr setrctl 2
57for the full description and purpose of the
58.Sy setrctl
59system call and its arguments.
60.Pp
61The
62.Fn pr_setrctl
63function only works on active processes.
64Process handles that correspond to core files, zombie processes, or ELF objects
65do not support system call injection.
66.Sh RETURN VALUES
67Upon successful completion, the
68.Fn pr_setrctl
69function's return value is that described in
70.Xr setrctl 2 .
71Otherwise,
72.Sy -1
73is returned and
74.Sy errno
75is set to
76.Er ENOSYS
77to indicate that the system call could not be injected.
78.Sh ERRORS
79For the full list of errors see the
80.Sy ERRORS
81section in
82.Xr setrctl 2 .
83.Pp
84The
85.Fn pr_setrctl
86function will fail if:
87.Bl -tag -width Er
88.It Er ENOSYS
89An error occurred while trying to invoke the agent LWP and inject a
90system call in the process handle
91.Fa P
92or the process handle
93.Fa P
94does not support system call injection.
95.El
96.Sh INTERFACE STABILITY
97.Sy Uncommitted
98.Sh MT-LEVEL
99See
100.Sy LOCKING
101in
102.Xr libproc 3LIB .
103.Sh SEE ALSO
104.Xr setrctl 2 ,
105.Xr libproc 3LIB ,
106.Xr proc 5
107