Syntax | #include <signal.h> int sigaltstack(const stack_t *ss, stack_t *oss); | |||||||
Description |
The int *ss_sp long ss_size int ss_flags If ss is not zero, the
If oss is not zero, on successful return from The
SIGSTKSZ represents the number of bytes that are generally necessary for an alternative stack. The value MINSIGSTKSZ defines here the minimum stack size for a signalhandling routine. When computing the stack size the program should still set up this minimum value in addition, to take into account the operating system’s own requirements. The constants SS_ONSTACK , SS_DISABLE , SIGSTKSZ and MINSIGSTKSZ are defined in <signal.h> . | |||||||
Return val. | 0 | if executed successfully. | ||||||
-1 | if an error occurs. | |||||||
Errors |
| |||||||
| An attempt was made to modify an active stack (deactivate). | |||||||
| The ss argument is not zero and the ss_flags component to which ss points contains other flags than | |||||||
| The size of the alternative stack area is less than | |||||||
Notes | The following program excerpt is used to allocate an alternative stack area: if ((sigstk.ss_sp = (char *)malloc(SIGSTKSZ)) == NULL) /* Error handling */; sigstk.ss_size = SIGSTKSZ; sigstk.ss_flags = 0; if (sigaltstack(&sigstk, (stack_t *)0) < 0) perror("sigaltstack"); | |||||||
See also |
|