1 PRELEASE(3PROC)        Process Control Library Functions       PRELEASE(3PROC)
   2 
   3 NAME
   4      Prelease, Pfree - release a process control handle
   5 
   6 LIBRARY
   7      Process Control Library (libproc, -lproc)
   8 
   9 SYNOPSIS
  10      #include <libproc.h>
  11 
  12      void
  13      Prelease(struct ps_prochandle *P, int flags);
  14 
  15      void
  16      Pfree(struct ps_prochandle *P);
  17 
  18 DESCRIPTION
  19      The Prelease() function is used to release all of the resources
  20      associated with a libproc handle.  It is suitable for handles to core
  21      files, created processes, and grabbed processes from the
  22      Pgrab_core(3PROC), Pcreate(3PROC), Pgrab(3PROC), and Pgrab_file(3PROC)
  23      functions.
  24 
  25      After calling the Prelease() function, all data that was returned via the
  26      handle will no longer be valid.  For example, the data from calls to
  27      Pctlfd(3PROC), Pgetauxvec(3PROC), Pstatus(3PROC), and others.
  28 
  29      The behavior of the released process is controlled by the flags argument.
  30      By default, if no flags are passed, then the process represented by P
  31      will be set running if it was created by Pcreate(3PROC) or if it was not
  32      originally stopped or set to stop in /proc.  The following values may be
  33      passed in to the flags argument.  Multiple flags should be be combined
  34      with a bitwise-inclusive-OR.
  35 
  36            PRELEASE_CLEAR     When releasing the process, clear all tracing
  37                               flags that are set on the process.
  38 
  39            PRELEASE_RETAIN    When releasing the process, retain all tracing
  40                               flags that are currently active on the process.
  41 
  42            PRELEASE_HANG      Leave the process stopped.  It will not resume
  43                               execution unless it is explicitly enabled with
  44                               prun(1) or another process explicitly enables
  45                               it.
  46 
  47            PRELEASE_KILL      Release the process and terminate it with
  48                               SIGKILL.  This option takes precedence over all
  49                               other values that may be passed in to flags.
  50 
  51      The Pfree() function is similar to the Prelease() function in that it
  52      frees the resources associated with the process handle P; however, unlike
  53      the Prelease() function, it does not handle any logic to change or set
  54      the grabbed processes state.  In general, prefer Prelease() to Pfree().
  55 
  56 INTERFACE STABILITY
  57      Uncommitted
  58 
  59 MT-LEVEL
  60      See LOCKING in libproc(3LIB).
  61 
  62 SEE ALSO
  63      prun(1), libproc(3LIB), Pcreate(3PROC), Pgrab(3PROC), Pgrab_core(3PROC),
  64      proc(4)
  65 
  66 illumos                          May 11, 2016                          illumos