1 PSETFLAGS(3PROC)       Process Control Library Functions      PSETFLAGS(3PROC)
   2 
   3 NAME
   4      Psetflags, Punsetflags - set and unset process flags
   5 
   6 LIBRARY
   7      Process Control Library (libproc, -lproc)
   8 
   9 SYNOPSIS
  10      #include <libproc.h>
  11 
  12      int
  13      Psetflags(struct ps_prochandle *P, long flags);
  14 
  15      int
  16      Punsetflags(struct ps_prochandle *P, long flags);
  17 
  18 DESCRIPTION
  19      The Psetflags() and Punsetflags() functions manipulate the process flags
  20      for the process handle P.  The process flags determine how the process
  21      behaves in the face of various actions.  For example, setting the PR_FORK
  22      flag indicates that the tracing flags of the process and the inherit-on-
  23      fork mode should be set on children.  A full list of the process flags is
  24      available in the PCSET section in proc(4).
  25 
  26      The Psetflags() function sets the flags specified in flags by doing a
  27      bitwise-inclusive-OR with the previously set flags.
  28 
  29      The Punsetflags() function removes the flags specified in flags from the
  30      tracing flags of the process.  Items not listed in flags will remain.
  31 
  32      To see the current set of flags active on the process, check the pr_flags
  33      member of the pstatus_t for the process.  It can be obtained through the
  34      Pstatus(3PROC) function.
  35 
  36      Note, attempting to modify the process flags only works on active
  37      processes.  Attempting to call these functions of process handles
  38      corresponding to core files, zombie processes, or files, will result in
  39      an error.
  40 
  41 RETURN VALUES
  42      Upon successful completion, the Psetflags() and Punsetflags() functions
  43      return 0.  Otherwise, -1 is returned and errno is set to indicate the
  44      error.
  45 
  46 ERRORS
  47      For a full list of possible errors see the DIAGNOSTICS section in
  48      proc(4).
  49 
  50 INTERFACE STABILITY
  51      Uncommitted
  52 
  53 MT-LEVEL
  54      See LOCKING in libproc(3LIB).
  55 
  56 SEE ALSO
  57      libproc(3LIB), Pstatus(3PROC), proc(4)
  58 
  59 illumos                          May 11, 2016                          illumos