143051d27SRobert Mustacchi.\" 243051d27SRobert Mustacchi.\" This file and its contents are supplied under the terms of the 343051d27SRobert Mustacchi.\" Common Development and Distribution License ("CDDL"), version 1.0. 443051d27SRobert Mustacchi.\" You may only use this file in accordance with the terms of version 543051d27SRobert Mustacchi.\" 1.0 of the CDDL. 643051d27SRobert Mustacchi.\" 743051d27SRobert Mustacchi.\" A full copy of the text of the CDDL should have accompanied this 843051d27SRobert Mustacchi.\" source. A copy of the CDDL is also available via the Internet at 943051d27SRobert Mustacchi.\" http://www.illumos.org/license/CDDL. 1043051d27SRobert Mustacchi.\" 1143051d27SRobert Mustacchi.\" 1243051d27SRobert Mustacchi.\" Copyright 2015 Joyent, Inc. 1343051d27SRobert Mustacchi.\" 1443051d27SRobert Mustacchi.Dd May 11, 2016 1543051d27SRobert Mustacchi.Dt PSETZONEID 3PROC 1643051d27SRobert Mustacchi.Os 1743051d27SRobert Mustacchi.Sh NAME 1843051d27SRobert Mustacchi.Nm Psetzoneid 1943051d27SRobert Mustacchi.Nd change processes zone id 20ab618543SJohn Levon.Sh LIBRARY 2143051d27SRobert Mustacchi.Lb libproc 22ab618543SJohn Levon.Sh SYNOPSIS 2343051d27SRobert Mustacchi.In libproc.h 2443051d27SRobert Mustacchi.Ft int 2543051d27SRobert Mustacchi.Fo Psetzoneid 2643051d27SRobert Mustacchi.Fa "struct ps_prochandle *P" 2743051d27SRobert Mustacchi.Fa "zoneid_t zoneid" 2843051d27SRobert Mustacchi.Fc 2943051d27SRobert Mustacchi.Sh DESCRIPTION 3043051d27SRobert MustacchiThe 3143051d27SRobert Mustacchi.Fn Psetzoneid 3243051d27SRobert Mustacchifunction moves the process handle 3343051d27SRobert Mustacchi.Fa P 3443051d27SRobert Mustacchiinto the zone specified by 3543051d27SRobert Mustacchi.Fa zoneid . 3643051d27SRobert MustacchiA process that is in the non-global zone may only move between the 3772d3dbb9SYuri Pankovglobal zone and its original zone. 3872d3dbb9SYuri PankovA process that is in the global zone may not use this interface to enter a 3972d3dbb9SYuri Pankovnon-global zone. 4072d3dbb9SYuri PankovThis function will fail if called from a non-global zone. 4172d3dbb9SYuri PankovThis function only manipulates the processes credentials. 4243051d27SRobert Mustacchi.Pp 4343051d27SRobert MustacchiCare should be taken when moving a process around temporarily, such that 4443051d27SRobert Mustacchiif the process that is manipulating 4543051d27SRobert Mustacchi.Fa P 4643051d27SRobert Mustacchidies, it does not cause 4743051d27SRobert Mustacchi.Fa P 4872d3dbb9SYuri Pankovto resume running while still in the global zone. 4972d3dbb9SYuri PankovIt is suggested that the 5043051d27SRobert Mustacchi.Sy PR_KLC 5143051d27SRobert Mustacchiflag is set with 5243051d27SRobert Mustacchi.Xr Psetflags 3PROC 5343051d27SRobert Mustacchiwhich will cause the process to terminate if the process that holds 5443051d27SRobert Mustacchi.Fa P 5572d3dbb9SYuri Pankovunexpectedly terminates. 5672d3dbb9SYuri PankovSee 57*bbf21555SRichard Lowe.Xr proc 5 5843051d27SRobert Mustacchifor more information on the 5943051d27SRobert Mustacchi.Sy PR_KLC 6043051d27SRobert Mustacchiflag. 6143051d27SRobert Mustacchi.Pp 6272d3dbb9SYuri PankovNote, only active processes may change their zone. 6372d3dbb9SYuri PankovIt is an error to call this function on process handles that correspond to core 6472d3dbb9SYuri Pankovfiles, zombie processes, or files. 6543051d27SRobert Mustacchi.Sh RETURN VALUES 6643051d27SRobert MustacchiUpon successful completion, the 6743051d27SRobert Mustacchi.Fn Psetzoneid 6843051d27SRobert Mustacchifunction returns 6943051d27SRobert Mustacchi.Sy 0 7043051d27SRobert Mustacchiand changes the zone for 7143051d27SRobert Mustacchi.Fa P . 7243051d27SRobert MustacchiOtherwise, 7343051d27SRobert Mustacchi.Sy -1 7443051d27SRobert Mustacchiis returned and 7543051d27SRobert Mustacchi.Sy errno 7643051d27SRobert Mustacchiis set. 7743051d27SRobert Mustacchi.Sh ERRORS 7843051d27SRobert MustacchiFor a full list of possible errors see the 7943051d27SRobert Mustacchi.Sy DIAGNOSTICS 8043051d27SRobert Mustacchisection in 81*bbf21555SRichard Lowe.Xr proc 5 . 8243051d27SRobert Mustacchi.Pp 8343051d27SRobert MustacchiThe 8443051d27SRobert Mustacchi.Fn Psetzoneid 8543051d27SRobert Mustacchifunction will fail if: 8643051d27SRobert Mustacchi.Bl -tag -width Er 8743051d27SRobert Mustacchi.It Er EINVAL 8843051d27SRobert Mustacchi.Fa zoneid 8943051d27SRobert Mustacchidoes not correspond to an existing zone or the zone id is not the global 9043051d27SRobert Mustacchizone or the original zone of 9143051d27SRobert Mustacchi.Fa P . 9243051d27SRobert Mustacchi.It Er EPERM 9343051d27SRobert MustacchiThe caller does not hold the required privileges for zone configuration. 9443051d27SRobert Mustacchi.El 9543051d27SRobert Mustacchi.Sh INTERFACE STABILITY 9643051d27SRobert Mustacchi.Sy Uncommitted 9743051d27SRobert Mustacchi.Sh MT-LEVEL 9843051d27SRobert MustacchiSee 9943051d27SRobert Mustacchi.Sy LOCKING 10043051d27SRobert Mustacchiin 10143051d27SRobert Mustacchi.Xr libproc 3LIB . 10243051d27SRobert Mustacchi.Sh SEE ALSO 10343051d27SRobert Mustacchi.Xr libproc 3LIB , 104*bbf21555SRichard Lowe.Xr proc 5 , 105*bbf21555SRichard Lowe.Xr privileges 7 , 106*bbf21555SRichard Lowe.Xr zones 7 107