1 PREOPEN(3PROC)         Process Control Library Functions        PREOPEN(3PROC)
   2 
   3 NAME
   4      Preopen - reopen a process
   5 
   6 LIBRARY
   7      Process Control Library (libproc, -lproc)
   8 
   9 SYNOPSIS
  10      #include <libproc.h>
  11 
  12      int
  13      Preopen(struct ps_prochandle *P);
  14 
  15 DESCRIPTION
  16      The Preopen() function is used to regain control of the process
  17      represented by the handle P.  A loss of control is indicated by the
  18      Pstatus(3PROC) function returning the value PS_LOST.  This may occur when
  19      the controlled process performs an exec(2) of a setuid or setgid binary
  20      or one where the controlling process cannot read the object file.  For
  21      more information on this, see the PROGRAMMING NOTES section of proc(4).
  22 
  23      If successful, the controlling process will obtain control of the process
  24      specified by P.  If it fails, the controlling process should release the
  25      handle with Prelease(3PROC).  Note there are occasions where due to
  26      permissions it may not be possible to obtain control again.
  27 
  28 RETURN VALUES
  29      Upon successful completion, the Preopen() function returns 0. Otherwise,
  30      -1 is returned.
  31 
  32 INTERFACE STABILITY
  33      Uncommitted
  34 
  35 MT-LEVEL
  36      See LOCKING in libproc(3LIB).
  37 
  38 SEE ALSO
  39      exec(2), libproc(3LIB), Prelease(3PROC), Pstatus(3PROC), proc(4)
  40 
  41 illumos                          May 11, 2016                          illumos