Unleashed v1.4
[unleashed.git] / share / man / man3proc / pr_waitid.3proc
blob9eceeb7eab6bc7797450da209b06d7b2d6ca4abe
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_WAITID 3PROC
16 .Os
17 .Sh NAME
18 .Nm pr_waitid
19 .Nd inject waitid system call into victim process
20 .Sh SYNOPSIS
21 .Lb libproc
22 .In libproc.h
23 .Ft int
24 .Fo pr_waitid
25 .Fa "struct ps_prochandle *P"
26 .Fa "idtype_t idtype"
27 .Fa "id_t id"
28 .Fa "siginfo_t *infop"
29 .Fa "int options"
30 .Fc
31 .Sh DESCRIPTION
32 The
33 .Fn pr_waitid
34 function injects the
35 .Xr waitid 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
41 is the value
42 .Dv NULL
43 then this will be equivalent to calling
44 .Xr waitid 2
45 on the currently running process.
46 .Pp
47 The arguments
48 .Fa idtype ,
49 .Fa id ,
50 .Fa infop ,
51 and
52 .Fa options
53 have the same meaning as in
54 .Xr waitid 2 .
55 See
56 .Xr waitid 2
57 for the full description and purpose of the
58 .Sy waitid
59 system call and its arguments.
60 .Pp
61 The
62 .Fn pr_waitid
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_waitid
69 function's return value is that described in
70 .Xr waitid 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 waitid 2 .
83 .Pp
84 The
85 .Fn pr_waitid
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 waitid 2 ,
105 .Xr libproc 3LIB ,
106 .Xr proc 4