PSETZONEID(3PROC) Process Control Library Functions PSETZONEID(3PROC)
NAME
Psetzoneid - change processes zone id
LIBRARY
Process Control Library (libproc, -lproc)
SYNOPSIS
#include <libproc.h> int Psetzoneid(
struct ps_prochandle *P,
zoneid_t zoneid);
DESCRIPTION
The
Psetzoneid() function moves the process handle
P into the zone
specified by
zoneid. A process that is in the non-global zone may only
move between the global zone and its original zone. A process that is in
the global zone may not use this interface to enter a non-global zone.
This function will fail if called from a non-global zone. This function
only manipulates the processes credentials.
Care should be taken when moving a process around temporarily, such that if
the process that is manipulating
P dies, it does not cause
P to resume
running while still in the global zone. It is suggested that the
PR_KLC flag is set with
Psetflags(3PROC) which will cause the process to terminate
if the process that holds
P unexpectedly terminates. See
proc(5) for more
information on the
PR_KLC flag.
Note, only active processes may change their zone. It is an error to call
this function on process handles that correspond to core files, zombie
processes, or files.
RETURN VALUES
Upon successful completion, the
Psetzoneid() function returns
0 and changes
the zone for
P. Otherwise,
-1 is returned and
errno is set.
ERRORS
For a full list of possible errors see the
DIAGNOSTICS section in
proc(5).
The
Psetzoneid() function will fail if:
EINVAL
zoneid does not correspond to an existing zone or the
zone id is not the global zone or the original zone of
P.
EPERM The caller does not hold the required privileges for
zone configuration.
INTERFACE STABILITY
UncommittedMT-LEVEL See
LOCKING in
libproc(3LIB).
SEE ALSO
libproc(3LIB),
proc(5),
privileges(7),
zones(7)illumos May 11, 2016 illumos