1 PLWP_GETSPYMASTER(3PROC)                     Process Control Library Functions
   2 
   3 NAME
   4      Plwp_getspymaster - get agent LWP spy master information
   5 
   6 LIBRARY
   7      Process Control Library (libproc, -lproc)
   8 
   9 SYNOPSIS
  10      #include <libproc.h>
  11 
  12      int
  13      Plwp_getspymaster(struct ps_prochandle *P, lwpid_t lwpid, psinfo_t *ps);
  14 
  15 DESCRIPTION
  16      The Plwp_getspymaster() function returns information about the spy master
  17      that corresponds to the agent LWP for the thread lwpid in the process
  18      handle P.
  19 
  20      The agent LWP allows another process to inject actions into the target
  21      process.  When an agent LWP is created, it leverages an existing thread
  22      in the process and it also creates a record of whom created the agent,
  23      which is called the spy master.  For more information on the agent LWP
  24      and the spy master, see proc(4).
  25 
  26      If the thread identified lwpid has an agent LWP, the corresponding ps
  27      information (see proc(4) for the definition of the psinfo_t) will be
  28      filled into ps.
  29 
  30      Note, process handles that correspond to a file, created by
  31      Pgrab_file(3PROC), cannot have an agent LWP created for them and thus
  32      cannot have any spy master information.  In addition, core files from
  33      older releases may not have any data on the spy master.
  34 
  35 RETURN VALUES
  36      Upon successful completion, the Plwp_getspymaster() returns 0 and updates
  37      ps.  Otherwise, it returns -1, sets errno, and ps is not modified.
  38 
  39 ERRORS
  40      For a full list of possible errors also see the DIAGNOSTICS section in
  41      proc(4).
  42 
  43      The Plwp_getpsinfo() function will fail if:
  44 
  45      ENODATA            P refers to a file handle obtained through
  46                         Pgrab_file(3PROC) or P does not have any information
  47                         about the spy master.
  48 
  49      EINVAL             The process handle P refers to a core file and the
  50                         specified thread does not exist.
  51 
  52                         The thread, lwpid does not have an active agent,
  53                         PR_AGENT is not set in the pr_flags member of the
  54                         thread's status information.
  55 
  56      ENOENT             The process handle P refers to an active process and
  57                         the specified thread does not exist.
  58 
  59 INTERFACE STABILITY
  60      Uncommitted
  61 
  62 MT-LEVEL
  63      See LOCKING in libproc(3LIB).
  64 
  65 SEE ALSO
  66      libproc(3LIB), proc(4)
  67 
  68 illumos                          May 11, 2016                          illumos