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

NAME


Prelease, Pfree - release a process control handle

LIBRARY


Process Control Library (libproc, -lproc)

SYNOPSIS


#include <libproc.h>

void
Prelease(struct ps_prochandle *P, int flags);

void
Pfree(struct ps_prochandle *P);

DESCRIPTION


The Prelease() function is used to release all of the resources associated
with a libproc handle. It is suitable for handles to core files, created
processes, and grabbed processes from the Pgrab_core(3PROC),
Pcreate(3PROC), Pgrab(3PROC), and Pgrab_file(3PROC) functions.

After calling the Prelease() function, all data that was returned via the
handle will no longer be valid. For example, the data from calls to
Pctlfd(3PROC), Pgetauxvec(3PROC), Pstatus(3PROC), and others.

The behavior of the released process is controlled by the flags argument.
By default, if no flags are passed, then the process represented by P will
be set running if it was created by Pcreate(3PROC) or if it was not
originally stopped or set to stop in /proc. The following values may be
passed in to the flags argument. Multiple flags should be be combined with
a bitwise-inclusive-OR.

PRELEASE_CLEAR When releasing the process, clear all tracing
flags that are set on the process.

PRELEASE_RETAIN When releasing the process, retain all tracing
flags that are currently active on the process.

PRELEASE_HANG Leave the process stopped. It will not resume
execution unless it is explicitly enabled with
prun(1) or another process explicitly enables it.

PRELEASE_KILL Release the process and terminate it with SIGKILL.
This option takes precedence over all other values
that may be passed in to flags.

The Pfree() function is similar to the Prelease() function in that it frees
the resources associated with the process handle P; however, unlike the
Prelease() function, it does not handle any logic to change or set the
grabbed processes state. In general, prefer Prelease() to Pfree().

INTERFACE STABILITY


Uncommitted

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

SEE ALSO


prun(1), libproc(3LIB), Pcreate(3PROC), Pgrab(3PROC), Pgrab_core(3PROC),
proc(4)

illumos May 11, 2016 illumos