1SIGALTSTACK(2)             Linux Programmer's Manual            SIGALTSTACK(2)
2
3
4

NAME

6       sigaltstack - get or set alternate signal stack content
7

SYNOPSIS

9       #include <signal.h>
10
11       int sigaltstack(const stack_t *ss, stack_t *oss);
12
13       where:
14
15       ss     points to a signalstack structure defined in <signal.h> contain‐
16              ing stack content after the call.
17
18       oss    if not NULL, points to a signalstack structure containing  stack
19              content before the call.
20

DESCRIPTION

22       sigaction(2)  may indicate that a signal should execute on an alternate
23       stack. Where this is the case, sigaltstack(2) stores the signal  in  an
24       alternate stack structure ss where its execution status may be examined
25       prior to processing.
26
27       The sigaltstack struct is defined in <signal.h> as follows:
28
29
30                  void       *ss_sp     /* SVID3 uses caddr_t ss_sp
31                  int        ss_flags
32                  size_t     ss_size
33       where:
34
35       ss_sp  points to the stack structure.
36
37       ss_flags
38              specifies the stack state to SS_DISABLE or  SS_ONSTACK  as  fol‐
39              lows:
40
41              If  ss is not NULL,the new state may be set to SS_DISABLE, which
42              specifies that the stack is to be disabled and ss_sp and ss_size
43              are  ignored.   If  SS_DISABLE  is  not  set,  the stack will be
44              enabled.
45
46              If oss is not NULL, the stack state may be either SS_ONSTACK  or
47              SS_DISABLE.  The  value SS_ONSTACK indicates that the process is
48              currently executing on the alternate stack and that any  attempt
49              to  modify  it during execution will fail.  The value SS_DISABLE
50              indicates that the current signal stack is disabled.
51
52       ss_size
53              specifies the size of the stack.
54
55       The value SIGSTKSZ defines the average number of bytes used when  allo‐
56       cating an alternate stack area.  The value MINSIGSTKSZ defines the min‐
57       imum stack size for a signal handler.   When  processing  an  alternate
58       stack  size,  your  program  should  include  these values in the stack
59       requirement to plan for the overhead of the operating system.
60

RETURN VALUES

62       sigaltstack(2) returns 0 on success and -1 on failure.
63

ERRORS

65       sigaltstack(2) sets  errno for the following conditions:
66
67       EINVAL ss is not a null pointer the ss_flags member pointed  to  by  ss
68              contains flags other than SS_DISABLE.
69
70       ENOMEM The size of the alternate stack area is less than MINSIGSTKSZ.
71
72       EPERM  An attempt was made to modify an active stack.
73

STANDARDS

75       This function comforms to: XPG4-UNIX.
76

SEE ALSO

78       getcontext(2), sigaction(2), sigsetjmp(3).
79
80
81
82Red Hat Linux 6.1              20 September 1999                SIGALTSTACK(2)
Impressum