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

Prelease, Pfreerelease a process control handle

Process Control Library (libproc, -lproc)

#include <libproc.h>

Prelease(struct ps_prochandle *P, int flags);

Pfree(struct ps_prochandle *P);

The () 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 () 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.

When releasing the process, clear all tracing flags that are set on the process.
When releasing the process, retain all tracing flags that are currently active on the process.
Leave the process stopped. It will not resume execution unless it is explicitly enabled with prun(1) or another process explicitly enables it.
Release the process and terminate it with SIGKILL. This option takes precedence over all other values that may be passed in to flags.

The () 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().

See in libproc(3LIB).

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

May 11, 2016 OmniOS