PCREATE_AGENT(3PROC) Process Control Library Functions PCREATE_AGENT(3PROC)

NAME


Pcreate_agent - create the agent LWP

LIBRARY


Process Control Library (libproc, -lproc)

SYNOPSIS


#include <libproc.h>

int
Pcreate_agent(struct ps_prochandle *P);

DESCRIPTION


The Pcreate_agent() function creates the agent LWP in the process
represented by the handle P. The agent LWP is used as a means to force
system calls to be invoked on the controlled process. For more information
on the agent LWP, see proc(5).

The agent LWP cannot be created for process handles corresponding to core
files, zombie processes, processes that have yet to run, and ELF objects.

The Pcreate_agent() function is reentrant. It may be entered recursively.
The act of creating the agent LWP will cause the process to be stopped.
For every call to the Pcreate_agent() function, a corresponding call to
Pdestroy_agent(3PROC) is required.

RETURN VALUES


Upon successful completion, the Pcreate_agent() function returns 0 and
creates the agent LWP. Otherwise, -1 is returned, errno is set to indicate
the error, and the agent LWP is not created.

ERRORS


The Pcreate_agent() function will fail if:

ENOENT The process referred to by P is a core file, zombie, ELF
object, or has not begun execution.

Note, it is possible for other error numbers to be returned. If they are,
they represent unanticipated failure.

INTERFACE STABILITY


Uncommitted

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

SEE ALSO


libproc(3LIB), Pdestroy_agent(3PROC), proc(5)

illumos May 11, 2016 illumos