1 PSETZONEID(3PROC) Process Control Library Functions PSETZONEID(3PROC) 2 3 NAME 4 Psetzoneid - change processes zone id 5 6 LIBRARY 7 Process Control Library (libproc, -lproc) 8 9 SYNOPSIS 10 #include <libproc.h> 11 12 int 13 Psetzoneid(struct ps_prochandle *P, zoneid_t zoneid); 14 15 DESCRIPTION 16 The Psetzoneid() function moves the process handle P into the zone 17 specified by zoneid. A process that is in the non-global zone may only 18 move between the global zone and its original zone. A process that is in 19 the global zone may not use this interface to enter a non-global zone. 20 This function will fail if called from a non-global zone. This function 21 only manipulates the processes credentials. 22 23 Care should be taken when moving a process around temporarily, such that 24 if the process that is manipulating P dies, it does not cause P to resume 25 running while still in the global zone. It is suggested that the PR_KLC 26 flag is set with Psetflags(3PROC) which will cause the process to 27 terminate if the process that holds P unexpectedly terminates. See 28 proc(4) for more information on the PR_KLC flag. 29 30 Note, only active processes may change their zone. It is an error to 31 call this function on process handles that correspond to core files, 32 zombie processes, or files. 33 34 RETURN VALUES 35 Upon successful completion, the Psetzoneid() function returns 0 and 36 changes the zone for P. Otherwise, -1 is returned and errno is set. 37 38 ERRORS 39 For a full list of possible errors see the DIAGNOSTICS section in 40 proc(4). 41 42 The Psetzoneid() function will fail if: 43 44 EINVAL zoneid does not correspond to an existing zone or the 45 zone id is not the global zone or the original zone of 46 P. 47 48 EPERM The caller does not hold the required privileges for 49 zone configuration. 50 51 INTERFACE STABILITY 52 Uncommitted 53 54 MT-LEVEL 55 See LOCKING in libproc(3LIB). 56 57 SEE ALSO 58 libproc(3LIB), proc(4), privileges(5), zones(5) 59 60 illumos May 11, 2016 illumos