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