1sigstack(3UCB)     SunOS/BSD Compatibility Library Functions    sigstack(3UCB)
2
3
4

NAME

6       sigstack - set and/or get signal stack context
7

SYNOPSIS

9       /usr/ucb/cc [ flag ... ] file ...
10       #include <signal.h>
11
12       int sigstack(nss, oss)
13       struct sigstack *nss, *oss;
14
15

DESCRIPTION

17       The  sigstack()  function  allows  users  to define an alternate stack,
18       called the "signal stack", on which signals are to be processed.   When
19       a  signal's  action  indicates its handler should execute on the signal
20       stack (specified with a sigvec(3UCB) call), the system checks to see if
21       the  process  is  currently executing on that stack.  If the process is
22       not currently executing on the signal  stack,  the  system  arranges  a
23       switch  to  the  signal  stack for the duration of the signal handler's
24       execution.
25
26
27       A signal stack is specified by a sigstack() structure,  which  includes
28       the following members:
29
30         char  *ss_sp;        /* signal stack pointer */
31         int   ss_onstack;    /* current status */
32
33
34
35       The  ss_sp  member  is  the  initial  value to be assigned to the stack
36       pointer when the system switches the process to the signal stack.  Note
37       that,  on  machines  where the stack grows downwards in memory, this is
38       not the address of  the  beginning  of  the  signal  stack  area.   The
39       ss_onstack  member is zero or non-zero depending on whether the process
40       is currently executing on the signal stack or not.
41
42
43       If nss is not a null pointer, sigstack() sets the signal stack state to
44       the  value  in  the sigstack() structure pointed to by nss. If nss is a
45       null pointer, the signal stack state will be unchanged.  If oss is  not
46       a  null  pointer,  the  current  signal  stack  state  is stored in the
47       sigstack() structure pointed to by oss.
48

RETURN VALUES

50       Upon successful completion, 0 is returned.  Otherwise, −1  is  returned
51       and errno is set to indicate the error.
52

ERRORS

54       The  sigstack()  function  will  fail and the signal stack context will
55       remain unchanged if one of the following occurs.
56
57       EFAULT    Either nss or oss points to memory that is not a  valid  part
58                 of the process address space.
59
60

SEE ALSO

62       sigaltstack(2), sigvec(3UCB), signal(3C)
63

WARNINGS

65       Signal  stacks are not "grown" automatically, as is done for the normal
66       stack.  If the stack overflows unpredictable results may occur.
67

NOTES

69       Use of these interfaces should be restricted to only applications writ‐
70       ten  on  BSD platforms.  Use of these interfaces with any of the system
71       libraries or in multi-threaded applications is unsupported.
72
73
74
75SunOS 5.11                        30 Oct 2007                   sigstack(3UCB)
Impressum