SIGSPACE(2) — HP-UX
NAME
sigspace − assure sufficient signal stack space
SYNOPSIS
#include <signal.h>
long sigspace(ss);
long ss;
DESCRIPTION
Sigspace allows users to define additional space for stack use which is guaranteed to be available if signals are to be processed. If ss is positive, it specifies a space, in bytes, which the system guarantees will be available when processing a signal. A zero value removes any guarantee of space and any negative value leaves the guarantee unchanged, and may be used to interrogate the current guaranteed value. When a signal’s action indicates its handler should use the guaranteed space (specified with a sigvector(2) call), the system checks to see if the process is currently using that space. If the process is not currently using that space the system arranges for that space to be available for the duration of the signal handler’s execution. If that space has already been made available (due to a previous signal) no change is made. The normal stack discipline is resumed when the signal causing the use of the guaranteed space is exited.
The guaranteed space is inherited by child processes after a fork but the guarantee of space is removed after an exec.
NOTES
The guaranteed space may not be increased in size automatically, as is done for the normal stack. If the stack overflows the guaranteed space unpredictable results may occur.
Guaranteeing space for a stack may cause interference with other memory allocation routines, in an implementation dependent manner.
During normal execution of the program the system checks for possible overflow of the stack. Guaranteeing space may cause the space available for normal execution to be reduced.
Leaving the context of a service routine in an abnormal way, such as by longjmp on setjmp(3C), may remove the guarantee that the ordinary execution of the program will not extend into the guaranteed space. It may also cause the program to forever lose its ability to automatically increase the stack size, and the program may then be limited to the guaranteed space.
RETURN VALUE
Upon successful completion, the size of the old guaranteed space is returned. Otherwise, a value of −1 is returned and errno is set to indicate the error.
ERRORS
Sigspace will fail and the guaranteed amount of space will remain unchanged if one of the following occurs.
[ENOMEM] Enough space cannot be guaranteed because of either hardware limitations or because some software imposed limit would be exceeded.
DEPENDENCIES
Series 300
The guaranteed space is allocated with malloc(3C). This call may thus interfere with other heap management mechanisms.
The kernel overhead taken in the reserved space is 440 bytes on Series 300. This overhead must be included in the requested amount. These values are subject to change in future releases.
BUGS
Methods for calculating the required size are not yet well developed.
AUTHOR
Sigspace was developed by the Hewlett-Packard Company.
SEE ALSO
Hewlett-Packard Company — May 11, 2021