SIGSTACK(2) COMMAND REFERENCE SIGSTACK(2) NAME sigstack - set and/or get signal stack context SYNOPSIS #include <sys/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 <sys/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. DIAGNOSTICS Sigstack will fail and the signal stack context will remain Printed 5/12/88 1
SIGSTACK(2) COMMAND REFERENCE SIGSTACK(2) 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), and setjmp(3f). Printed 5/12/88 2
%%index%% na:336,98; sy:434,796; de:1230,2241; di:3471,267;4146,185; rv:4331,546; se:4877,207; %%index%%000000000118