sigaction.2 (2010 09)

s
sigaction(2) sigaction(2)
will not fail with [EINTR] unless otherwise specified. If the flag is not set,
interruptible functions interrupted by this signal will fail with
errno set
to [EINTR].
SA_SIGINFO If cleared and the signal is caught, the signal-catching function will be
entered as:
void func(int signo); where signo is the only argument to the
signal catching function. In this case the sa_handler member must be used
to describe the signal catching function and the application must not
modify the sa_sigaction member.
If
SA_SIGINFO is set and the signal is caught, the signal-catching func-
tion will be entered as:
void func(int signo, siginfo_t *info, void *con-
text); where two additional arguments are passed to the signal catching
function. If the second argument is not a null pointer, it will point to an
object of type siginfo_t explaining the reason why the signal was generated;
the third argument can be cast to a pointer to an object of type ucontext_t
to refer to the context of the receiving process or thread that was inter-
rupted when the signal was delivered. In this case the sa_sigaction
member must be used to describe the signal catching function and the
application must not modify the sa_handler member.
The si_signo member of info contains the system-generated signal number.
The si_errno member may contain implementation-dependent additional
error information; if non-zero, it contains an error number identifying the
condition that caused the signal to be generated.
The si_code member contains a code identifying the cause of the signal. If
the value of si_code is less than or equal to 0, then the signal was gen-
erated by a process and si_pid and si_uid respectively indicate the process
ID and the real user ID of the sender. The values of si_pid and si_uid are
otherwise meaningless.
If
SA_SIGINFO is set in sa_flags , subsequent occurrences of sig generated
by sigqueue() or as a result of any signal-generating function that sup-
ports the specification of an application-defined value - when sig is already
pending - will be queued in FIFO order until delivered, and the application
specified value will be passed to the signal-catching function as the
si_value member of info (See Realtime Signals Extension ). If
SA_SIGINFO is not set in sa_flags , then the disposition of subsequent
occurrences of sig when it is already pending is implementation-defined.
SA_NOCLDWAIT If set, and sig equals SIGCHLD, child processes of the calling process will
not be transformed into zombie processes when they terminate. If the cal-
ling process subsequently waits for its children, and the process has no
unwaited for children that were transformed into zombie processes, it will
block until all of its children terminate, and wait(), wait3(),
waitid(), and waitpid() will fail and set errno to [ECHILD]. Other-
wise, terminating child processes will be transformed into zombie
processes, unless SIGCHLD is set to SIG_IGN.
SA_NODEFER If set and sig is caught, sig will not be added to the process signal mask on
entry to the signal handler unless it is included in sa_mask . Otherwise, sig
will always be added to the process signal mask on entry to the signal
handler.
If sig is
SIGCHLD and the SA_NOCLDSTOP flag is not set in sa_flags, and the implementation supports
the SIGCHLD signal, then a SIGCHLD signal will be generated for the calling process whenever any of its
child processes stop. If sig is SIGCHLD and the SA_NOCLDSTOP flag is set in sa_flags, then the imple-
mentation will not generate a SIGCHLD signal in this way.
When a signal is caught by a signal-catching function installed by
sigaction(), a new signal mask is
calculated and installed for the duration of the signal-catching function (or until a call to either sig-
procmask() or sigsuspend() is made). This mask is formed by taking the union of the current
2 Hewlett-Packard Company 2 HP-UX 11i Version 3: September 2010