United States-English |
|
|
HP-UX Reference > Ssigspace(2)HP-UX 11i Version 3: February 2007 |
|
NAMEsigspace — assure sufficient signal stack space DESCRIPTIONsigspace() 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 processing 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 guaranteed space (specified with a sigaction() or sigvec() 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 execution. 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 fork() system call, but the guarantee of space is removed after any exec() 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 allocation 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 available for normal execution to be reduced. Leaving the context of a service routine abnormally, such as by longjmp() (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 VALUEUpon successful completion, sigspace() returns the size of the former guaranteed space. Otherwise, it returns -1 and sets errno to indicate the error. ERRORSsigspace() fails and the guaranteed amount of space remains unchanged if the following occurs:
WARNINGSThe 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 sigspace() in conjunction with the facilities described under sigset(3C). Do not use sigspace() in conjunction with sigstack(2). In HP-UX release 11.11, use of sigspace() in threads created with process contention scope could result in undefined behavior. This function will continue to be reliable in threads created with system contention scope. |
Printable version | ||
|