xref: /illumos-gate/usr/src/man/man3proc/pr_waitid.3proc (revision d48be21240dfd051b689384ce2b23479d757f2d8)
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
32The
33.Fn pr_waitid
34function injects the
35.Xr waitid 2
36system call into the target process
37.Fa P
38by means of the agent LWP.
39If the process handle
40.Fa P
41is the value
42.Dv NULL
43then this will be equivalent to calling
44.Xr waitid 2
45on the currently running process.
46.Pp
47The arguments
48.Fa idtype ,
49.Fa id ,
50.Fa infop ,
51and
52.Fa options
53have the same meaning as in
54.Xr waitid 2 .
55See
56.Xr waitid 2
57for the full description and purpose of the
58.Sy waitid
59system call and its arguments.
60.Pp
61The
62.Fn pr_waitid
63function only works on active processes.
64Process handles that correspond to core files, zombie processes, or ELF objects
65do not support system call injection.
66.Sh RETURN VALUES
67Upon successful completion, the
68.Fn pr_waitid
69function's return value is that described in
70.Xr waitid 2 .
71Otherwise,
72.Sy -1
73is returned and
74.Sy errno
75is set to
76.Er ENOSYS
77to indicate that the system call could not be injected.
78.Sh ERRORS
79For the full list of errors see the
80.Sy ERRORS
81section in
82.Xr waitid 2 .
83.Pp
84The
85.Fn pr_waitid
86function will fail if:
87.Bl -tag -width Er
88.It Er ENOSYS
89An error occurred while trying to invoke the agent LWP and inject a
90system call in the process handle
91.Fa P
92or the process handle
93.Fa P
94does not support system call injection.
95.El
96.Sh INTERFACE STABILITY
97.Sy Uncommitted
98.Sh MT-LEVEL
99See
100.Sy LOCKING
101in
102.Xr libproc 3LIB .
103.Sh SEE ALSO
104.Xr waitid 2 ,
105.Xr libproc 3LIB ,
106.Xr proc 5
107