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