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