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