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