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

NAME


Psetflags, Punsetflags - set and unset process flags

LIBRARY


Process Control Library (libproc, -lproc)

SYNOPSIS


#include <libproc.h>

int
Psetflags(struct ps_prochandle *P, long flags);

int
Punsetflags(struct ps_prochandle *P, long flags);

DESCRIPTION


The Psetflags() and Punsetflags() functions manipulate the process
flags for the process handle P. The process flags determine how the
process behaves in the face of various actions. For example, setting
the PR_FORK flag indicates that the tracing flags of the process and
the inherit-on-fork mode should be set on children. A full list of the
process flags is available in the PCSET section in proc(5).

The Psetflags() function sets the flags specified in flags by doing a
bitwise-inclusive-OR with the previously set flags.

The Punsetflags() function removes the flags specified in flags from
the tracing flags of the process. Items not listed in flags will
remain.

To see the current set of flags active on the process, check the
pr_flags member of the pstatus_t for the process. It can be obtained
through the Pstatus(3PROC) function.

Note, attempting to modify the process flags only works on active
processes. Attempting to call these functions of process handles
corresponding to core files, zombie processes, or files, will result in
an error.

RETURN VALUES


Upon successful completion, the Psetflags() and Punsetflags() functions
return 0. Otherwise, -1 is returned and errno is set to indicate the
error.

ERRORS


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

INTERFACE STABILITY


Uncommitted

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

SEE ALSO


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

illumos May 11, 2016 illumos

tribblix@gmail.com :: GitHub :: Privacy