16096 want proc_get_lwpstatus(3PROC)
[illumos-gate.git] / usr / src / man / man3proc / pr_processor_bind.3proc
blob23f160d1c903fe5be23d72d114a4e4e2e4884ec7
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 November 27, 2023
15 .Dt PR_PROCESSOR_BIND 3PROC
16 .Os
17 .Sh NAME
18 .Nm pr_processor_bind
19 .Nd inject processor_bind system call into victim process
20 .Sh LIBRARY
21 .Lb libproc
22 .Sh SYNOPSIS
23 .In libproc.h
24 .Ft int
25 .Fo pr_processor_bind
26 .Fa "struct ps_prochandle *P"
27 .Fa "idtype_t idtype"
28 .Fa "id_t id"
29 .Fa "int processorid"
30 .Fa "int *obind"
31 .Fc
32 .Sh DESCRIPTION
33 The
34 .Fn pr_processor_bind
35 function injects the
36 .Xr processor_bind 2
37 system call into the target process
38 .Fa P
39 by means of the agent LWP.
40 If the process handle
41 .Fa P
42 is the value
43 .Dv NULL
44 then this will be equivalent to calling
45 .Xr processor_bind 2
46 on the currently running process.
47 .Pp
48 The arguments
49 .Fa idtype ,
50 .Fa id ,
51 .Fa processorid ,
52 and
53 .Fa obind
54 have the same meaning as in
55 .Xr processor_bind 2 .
56 See
57 .Xr processor_bind 2
58 for the full description and purpose of the
59 .Sy processor_bind
60 system call and its arguments.
61 .Pp
62 The
63 .Fn pr_processor_bind
64 function only works on active processes.
65 Process handles that correspond to core files, zombie processes, or ELF objects
66 do not support system call injection.
67 .Sh RETURN VALUES
68 Upon successful completion, the
69 .Fn pr_processor_bind
70 function's return value is that described in
71 .Xr processor_bind 2 .
72 Otherwise,
73 .Sy -1
74 is returned and
75 .Sy errno
76 is set to
77 .Er ENOSYS
78 to indicate that the system call could not be injected.
79 .Sh ERRORS
80 For the full list of errors see the
81 .Sy ERRORS
82 section in
83 .Xr processor_bind 2 .
84 .Pp
85 The
86 .Fn pr_processor_bind
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 processor_bind 2 ,
106 .Xr libproc 3LIB ,
107 .Xr proc 5