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

Pfaultenable and disable the tracing of faults

Process Control Library (libproc, -lproc)

#include <libproc.h>

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

The () function controls what the process P should do on faults.

A fault is a hardware event that occurs in the context of a running process and thread. A hardware fault may occur because an illegal instruction was executed, a breakpoint or watchpoint was encountered, or an arithmetic exception occurred, among others. The full list of faults is available in both proc(5) and <sys/fault.h>.

For each hardware fault, a process may be configured to stop the thread that encountered it when it occurs. The value of the stop parameter controls whether or not the listed fault in which will cause the thread to trap. A value of 1 indicates the thread should stop; a value of 0 indicates it should not.

The value of which indicates which hardware fault the change applies to. However, if the value of which is zero, then it applies to all faults.

The () function only applies to actively running processes. It does not function on handles that refer to core files, zombie processes, or ELF objects.

Upon successful completion, the Pfault() function returns the old disposition of the fault -- if it was not set to stop and 1 if it was -- and the fault state is updated. Otherwise, -1 is returned, errno is updated with the error that occurred, and the fault state is not updated.

The Pfault() function will fail if:

The value of which is invalid, e.g. it is less than zero or greater than the largest defined fault.
The handle P refers to a process that is a zombie, a core file, or a file.

See in libproc(3LIB).

libproc(3LIB), proc(5)

May 11, 2016 OmniOS