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