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

get process sigaction information

Process Control Library (libproc, -lproc)
#include <libproc.h>

proc_get_sigact(pid_t pid, struct sigaction **sigact, size_t *np);

The proc_get_sigact() function is a convenient way to read the /proc sigact file for the process pid.

If *sigact is not NULL, the contents of *sigact is populated with the contents of the sigact file, up to *np entries. If *np is larger than the number of entries read, the contents beyond the last entry read are not modified.

If *sigact is NULL, proc_get_sigact() allocates a buffer sufficiently large to hold the entries from the sigact file, populates the newly allocated buffer with the contents of the sigact file, and sets *sigact to point to the newly allocated buffer. When this occurs, the caller is responsible for freeing the buffer.

In either situation, *np is set to the actual number of struct sigaction entries written from the sigact file into *sigact.

Upon succesful completion, the proc_get_sigact function returns 0. Otherwise -1 is returned to indicate an error occurred.



sigaction(2), libproc(3LIB), proc(4)
April 15, 2020 illumos