PLWP_GETSPYMASTER(3PROC) Process Control Library Functions

NAME


Plwp_getspymaster - get agent LWP spy master information

LIBRARY


Process Control Library (libproc, -lproc)

SYNOPSIS


#include <libproc.h>

int
Plwp_getspymaster(struct ps_prochandle *P, lwpid_t lwpid, psinfo_t *ps);

DESCRIPTION


The Plwp_getspymaster() function returns information about the spy master
that corresponds to the agent LWP for the thread lwpid in the process
handle P.

The agent LWP allows another process to inject actions into the target
process. When an agent LWP is created, it leverages an existing thread in
the process and it also creates a record of whom created the agent, which
is called the spy master. For more information on the agent LWP and the
spy master, see proc(4).

If the thread identified lwpid has an agent LWP, the corresponding ps
information (see proc(4) for the definition of the psinfo_t) will be filled
into ps.

Note, process handles that correspond to a file, created by
Pgrab_file(3PROC), cannot have an agent LWP created for them and thus
cannot have any spy master information. In addition, core files from older
releases may not have any data on the spy master.

RETURN VALUES


Upon successful completion, the Plwp_getspymaster() returns 0 and updates
ps. Otherwise, it returns -1, sets errno, and ps is not modified.

ERRORS


For a full list of possible errors also see the DIAGNOSTICS section in
proc(4).

The Plwp_getpsinfo() function will fail if:

ENODATA P refers to a file handle obtained through
Pgrab_file(3PROC) or P does not have any information
about the spy master.

EINVAL The process handle P refers to a core file and the
specified thread does not exist.

The thread, lwpid does not have an active agent,
PR_AGENT is not set in the pr_flags member of the
thread's status information.

ENOENT The process handle P refers to an active process and the
specified thread does not exist.

INTERFACE STABILITY


Uncommitted

MT-LEVEL
See LOCKING in libproc(3LIB).

SEE ALSO


libproc(3LIB), proc(4)

illumos May 11, 2016 illumos