16096 want proc_get_lwpstatus(3PROC)
[illumos-gate.git] / usr / src / man / man3proc / pr_getzoneid.3proc
blobfe7c030eb1e51d0d17f8807e40ccab8ea8444f1b
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_GETZONEID 3PROC
16 .Os
17 .Sh NAME
18 .Nm pr_getzoneid
19 .Nd inject getzoneid system call into victim process
20 .Sh LIBRARY
21 .Lb libproc
22 .Sh SYNOPSIS
23 .In libproc.h
24 .Ft zoneid_t
25 .Fo pr_getzoneid
26 .Fa "struct ps_prochandle *P"
27 .Fc
28 .Sh DESCRIPTION
29 The
30 .Fn pr_getzoneid
31 function injects the
32 .Xr getzoneid 3C
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
38 is the value
39 .Dv NULL
40 then this will be equivalent to calling
41 .Xr getzoneid 3C
42 on the currently running process.
43 .Pp
44 The
45 .Fn pr_getzoneid
46 function only works on active processes.
47 Process handles that correspond to core files, zombie processes, or ELF objects
48 do not support system call injection.
49 .Sh RETURN VALUES
50 Upon successful completion, the
51 .Fn pr_getzoneid
52 function's return value is that described in
53 .Xr getzoneid 3C .
54 Otherwise,
55 .Sy -1
56 is returned and
57 .Sy errno
58 is set to
59 .Er ENOSYS
60 to indicate that the system call could not be injected.
61 .Sh ERRORS
62 For the full list of errors see the
63 .Sy ERRORS
64 section in
65 .Xr getzoneid 3C .
66 .Pp
67 The
68 .Fn pr_getzoneid
69 function will fail if:
70 .Bl -tag -width Er
71 .It Er ENOSYS
72 An error occurred while trying to invoke the agent LWP and inject a
73 system call in the process handle
74 .Fa P
75 or the process handle
76 .Fa P
77 does not support system call injection.
78 .El
79 .Sh INTERFACE STABILITY
80 .Sy Uncommitted
81 .Sh MT-LEVEL
82 See
83 .Sy LOCKING
85 .Xr libproc 3LIB .
86 .Sh SEE ALSO
87 .Xr getzoneid 3C ,
88 .Xr libproc 3LIB ,
89 .Xr proc 5