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 PREOPEN 3PROC 1643051d27SRobert Mustacchi.Os 1743051d27SRobert Mustacchi.Sh NAME 1843051d27SRobert Mustacchi.Nm Preopen 1943051d27SRobert Mustacchi.Nd reopen a process 20ab618543SJohn Levon.Sh LIBRARY 2143051d27SRobert Mustacchi.Lb libproc 22ab618543SJohn Levon.Sh SYNOPSIS 2343051d27SRobert Mustacchi.In libproc.h 2443051d27SRobert Mustacchi.Ft int 2543051d27SRobert Mustacchi.Fo Preopen 2643051d27SRobert Mustacchi.Fa "struct ps_prochandle *P" 2743051d27SRobert Mustacchi.Fc 2843051d27SRobert Mustacchi.Sh DESCRIPTION 2943051d27SRobert MustacchiThe 3043051d27SRobert Mustacchi.Fn Preopen 3143051d27SRobert Mustacchifunction is used to regain control of the process represented by the 3243051d27SRobert Mustacchihandle 3343051d27SRobert Mustacchi.Fa P . 3443051d27SRobert MustacchiA loss of control is indicated by the 3543051d27SRobert Mustacchi.Xr Pstatus 3PROC 3643051d27SRobert Mustacchifunction returning the value 3743051d27SRobert Mustacchi.Dv PS_LOST . 3843051d27SRobert MustacchiThis may occur when the controlled process performs an 3943051d27SRobert Mustacchi.Xr exec 2 4043051d27SRobert Mustacchiof a setuid or setgid binary or one where the controlling process cannot 4172d3dbb9SYuri Pankovread the object file. 4272d3dbb9SYuri PankovFor more information on this, see the 4343051d27SRobert Mustacchi.Sy PROGRAMMING NOTES 4443051d27SRobert Mustacchisection of 45*bbf21555SRichard Lowe.Xr proc 5 . 4643051d27SRobert Mustacchi.Pp 4743051d27SRobert MustacchiIf successful, the controlling process will obtain control of the 4843051d27SRobert Mustacchiprocess specified by 4943051d27SRobert Mustacchi.Fa P . 5043051d27SRobert MustacchiIf it fails, the controlling process should release the handle with 5143051d27SRobert Mustacchi.Xr Prelease 3PROC . 5243051d27SRobert MustacchiNote there are occasions where due to permissions it may not be possible 5343051d27SRobert Mustacchito obtain control again. 5443051d27SRobert Mustacchi.Sh RETURN VALUES 5543051d27SRobert MustacchiUpon successful completion, the 5643051d27SRobert Mustacchi.Fn Preopen 5743051d27SRobert Mustacchifunction returns 5843051d27SRobert Mustacchi.Sy 0. 5943051d27SRobert MustacchiOtherwise, 6043051d27SRobert Mustacchi.Sy -1 6143051d27SRobert Mustacchiis returned. 6243051d27SRobert Mustacchi.Sh INTERFACE STABILITY 6343051d27SRobert Mustacchi.Sy Uncommitted 6443051d27SRobert Mustacchi.Sh MT-LEVEL 6543051d27SRobert MustacchiSee 6643051d27SRobert Mustacchi.Sy LOCKING 6743051d27SRobert Mustacchiin 6843051d27SRobert Mustacchi.Xr libproc 3LIB . 6943051d27SRobert Mustacchi.Sh SEE ALSO 7043051d27SRobert Mustacchi.Xr exec 2 , 7143051d27SRobert Mustacchi.Xr libproc 3LIB , 7243051d27SRobert Mustacchi.Xr Prelease 3PROC , 7343051d27SRobert Mustacchi.Xr Pstatus 3PROC , 74*bbf21555SRichard Lowe.Xr proc 5 75