1 PSETRUN(3PROC)         Process Control Library Functions        PSETRUN(3PROC)
   2 
   3 NAME
   4      Psetrun, Lsetrun - run a stopped process or thread
   5 
   6 LIBRARY
   7      Process Control Library (libproc, -lproc)
   8 
   9 SYNOPSIS
  10      #include <libproc.h>
  11 
  12      int
  13      Psetrun(struct ps_prochandle *P, int sig, int flags);
  14 
  15      int
  16      Lsetrun(struct ps_lwphandle *L, int sig, int flags);
  17 
  18 DESCRIPTION
  19      The Psetrun() function resumes the stopped process handle P and
  20      transitions the process to running.  If sig is non-zero, then the
  21      Psetrun() function causes the signal to be delivered.  See
  22      signal.h(3HEAD) for a list of valid signal identifiers.
  23 
  24      The flags member modifies the behavior of the resumed handle.  The
  25      following values may be combined by a bitwise-inclusive-OR:
  26 
  27            PRCSIG        Clears the current signal, if any.
  28 
  29            PRCFAULT      Clears the current fault, if any.
  30 
  31            PRSTEP        Indicates that the thread should single-step over the
  32                          next machine instruction and upon completion, inject
  33                          a trap.  For the specific mechanics of single-
  34                          stepping and what traps or signals will be injected,
  35                          see the PRSTEP section of proc(4).
  36 
  37            PRSABORT      Indicates that the thread should abort the system
  38                          call that it is currently executing.  This is only
  39                          valid if the thread is stopped because it is asleep
  40                          or right before a system call.  This will cause the
  41                          system call to return EINTR.
  42 
  43      If both PRCSIG is specified and sig is non-zero, then the PRCSIG request
  44      takes priority, and it will be treated as though sig was passed the
  45      argument 0.
  46 
  47      When the process is resumed all extent tracing flags and register changes
  48      will be synchronized with the process.  For more information on resuming
  49      a thread see the PCRUN section in proc(4).
  50 
  51      Note, the Psetrun() function is only valid for active processes.  It will
  52      fail on process handles that refer to core files, zombie processes, and
  53      ELF objects.
  54 
  55      The Lsetrun() function is equivalent to the Psetrun() function, except
  56      rather than operating on a process it operates on a thread.  Lsetrun()
  57      causes the specified thread, L, to resume execution.  Whereas Psetrun()
  58      causes all threads in the process to resume.
  59 
  60 RETURN VALUES
  61      Upon successful completion, the Psetrun() and Lsetrun() functions return
  62      0.  Otherwise, -1 is returned and errno is set to indicate the error.
  63 
  64 ERRORS
  65      For a full list of possible errors see the DIAGNOSTICS section in
  66      proc(4).
  67 
  68      The Psetrun() and Lsetrun() functions will fail if:
  69 
  70      EBUSY              The process handle P is not currently stopped or it is
  71                         not stopped due to an event of interest, a directed
  72                         stop, or it is asleep in a system call.
  73 
  74 INTERFACE STABILITY
  75      Uncommitted
  76 
  77 MT-LEVEL
  78      See LOCKING in libproc(3LIB).
  79 
  80 SEE ALSO
  81      signal.h(3HEAD), libproc(3LIB), Pstatus(3PROC), proc(4)
  82 
  83 illumos                          May 11, 2016                          illumos