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

NAME


Psignal - set signal tracing action

LIBRARY


Process Control Library (libproc, -lproc)

SYNOPSIS


#include <libproc.h>

int
Psignal(struct ps_prochandle *P, int which, int stop);

DESCRIPTION


The Psignal() function sets the signal tracing flag for the process handle
P. If stop is non-zero it causes the process handle to stop threads that
encounter the signal which. If stop is zero, then it disables tracing for
the signal which.

The signal constants, representing valid values for which, can be found in
signal.h(3HEAD). The signal SIGKILL may not be stopped.

Note, only active processes may have their signal tracing flags updated.
Process handles that refer to core files, zombie processes, and files do
not have signal tracing flags. Calling this function on them is an error.

RETURN VALUES


Upon successful completion, the Psignal() function returns the previous
disposition of the signal which. It returns 1 if it was set and 0 if not.
Otherwise, -1 is returned and errno is set to indicate the error.

ERRORS


The Psignal() function will fail if:

EINVAL which is SIGKILL and stop is non-zero .

which is not a valid signal.

ENOENT P does not correspond to an active process.

INTERFACE STABILITY


Uncommitted

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

SEE ALSO


signal.h(3HEAD), libproc(3LIB), Psetsignal(3PROC), proc(5)

illumos May 11, 2016 illumos