sigspace(2)sigspace(2)NAMEsigspace - assure sufficient signal stack space
SYNOPSISDESCRIPTION
requests additional stack space that is guaranteed to be available for
processing signals received by the calling process.
If the value of stacksize is positive, it specifies the size of a
space, in bytes, which the system guarantees to be available when pro‐
cessing a signal. If the value of stacksize is zero, any guarantee of
space is removed. If the value is negative, the guarantee is left
unchanged; this can be used to interrogate the current guaranteed
value.
When a signal's action indicates that its handler should use the guar‐
anteed space (specified with a or call (see bsdproc(3C)), 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 execu‐
tion. If that space has already been made available (due to a previous
signal), no change is made. Normal stack discipline is resumed when
the signal handler first using the guaranteed space is exited.
The guaranteed space is inherited by child processes resulting from a
successful system call, but the guarantee of space is removed after any
system call (see fork(2) and exec(2)).
The guaranteed space cannot be increased in size automatically, as is
done for the normal stack. If the stack overflows the guaranteed
space, the resulting behavior of the process is undefined.
Guaranteeing space for a stack can interfere with other memory alloca‐
tion routines in an implementation-dependent manner.
During normal execution of the program, the system checks for possible
overflow of the stack. Guaranteeing space might cause the space avail‐
able for normal execution to be reduced.
Leaving the context of a service routine abnormally, such as by (see
setjmp(3C)), removes the guarantee that the ordinary execution of the
program will not extend into the guaranteed space. It might also cause
the program to lose forever its ability to automatically increase the
stack size, causing the program to be limited to the guaranteed space.
RETURN VALUE
Upon successful completion, returns the size of the former guaranteed
space. Otherwise, it returns −1 and sets to indicate the error.
ERRORS
fails and the guaranteed amount of space remains unchanged if the fol‐
lowing occurs:
[ENOMEM] The requested space cannot be guaranteed,
either because of hardware limitations or
because some software-imposed limit would be
exceeded.
WARNINGS
The guaranteed space is allocated using malloc(3C). This use might
interfere with other heap management mechanisms.
Methods for calculating the required size are not well developed.
Do not use in conjunction with the facilities described under
sigset(3C).
Do not use in conjunction with sigstack(2).
In HP-UX release 11.11, use of in threads created with process con‐
tention scope could result in undefined behavior. This function will
continue to be reliable in threads created with system contention
scope.
APPLICATION USAGE
Threads Considerations
Each thread may define an alternate signal handling stack.
LWP (Lightweight Processes) Considerations
Each LWP may define an alternate signal handling stack.
AUTHOR
was developed by HP.
SEE ALSOsigaction(2), sigstack(2), malloc(3C), setjmp(3C).
sigspace(2)