SIGSTACK(2) COMMAND REFERENCE SIGSTACK(2)
NAME
sigstack - set and/or get signal stack context
SYNOPSIS
#include <signal.h>
sigstack(ss, oss);
struct sigstack *ss, *oss;
DESCRIPTION
Sigstack allows users to define an alternate stack on which
signals are to be processed. If ss is non-zero, it
specifies a signal stack on which to deliver signals and
tells the system if the process is currently executing on
that stack. The signal stack structure is defined in
<signal.h> as:
struct sigstack {
char *ss_sp; /* signal stack pointer */
int ss_onstack; /* current status */
};
When a signal's action indicates its handler should execute
on the signal stack (specified with a sigvec(2) call), the
system checks to see if the process is currently executing
on that stack. If the process is not currently executing on
the signal stack, the system arranges a switch to the signal
stack for the duration of the signal handler's execution.
If oss is non-zero, the current signal stack state is
returned, and oss->ss_onstack is set to zero or one
depending on whether the signal stack is currently in use.
The value of ss->ss_onstack instructs the system as to
whether the process is currently executing on an interrupt
stack. If the value is nonzero, the kernel is led to
believe that an interrupt stack is in use; if the value is
zero, the kernel believes that the process is executing on
the default stack. When an interrupt stack is in use, the
system does two things differently:
• If the process attempts to grow the stack into an
unallocated page, then the kernel delivers a
segmentation violation to the process. Normally the
kernel allocates the new page and allows the process to
proceed.
• If the kernel delivers a signal that calls for the
signal stack and the process is already using a signal
stack, then the kernel does not make any change to the
process stack pointer.
Printed 10/17/86 1
SIGSTACK(2) COMMAND REFERENCE SIGSTACK(2)
DIAGNOSTICS
Sigstack will fail and the signal stack context will remain
unchanged if one of the following occurs:
[EFAULT]
Either ss or oss points to memory which is not a valid
part of the process address space.
RETURN VALUE
If oss is non-zero, upon successful completion the current
signal stack state is returned in oss and sigstack returns a
value of 0. If oss is NULL, upon successful completion a
value of 0 is returned. If an error occurs, a value of -1
is returned and errno is set to indicate the error.
SEE ALSO
sigvec(2), setjmp(3c), setjmp(3f).
Printed 10/17/86 2
%%index%%
na:72,82;
sy:154,488;
de:642,2168;
di:2954,372;
rv:3326,470;
se:3796,172;
%%index%%000000000107