Commit | Line | Data |
---|---|---|
88b3ccf2 KB |
1 | .\" Copyright (c) 1983 The Regents of the University of California. |
2 | .\" All rights reserved. | |
39861f6c | 3 | .\" |
88b3ccf2 KB |
4 | .\" Redistribution and use in source and binary forms are permitted |
5 | .\" provided that the above copyright notice and this paragraph are | |
6 | .\" duplicated in all such forms and that any documentation, | |
7 | .\" advertising materials, and other materials related to such | |
8 | .\" distribution and use acknowledge that the software was developed | |
9 | .\" by the University of California, Berkeley. The name of the | |
10 | .\" University may not be used to endorse or promote products derived | |
11 | .\" from this software without specific prior written permission. | |
12 | .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR | |
13 | .\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED | |
14 | .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | |
15 | .\" | |
16 | .\" @(#)sigstack.2 6.3 (Berkeley) %G% | |
39861f6c | 17 | .\" |
3a2b5451 | 18 | .TH SIGSTACK 2 "" |
39861f6c KM |
19 | .UC 5 |
20 | .SH NAME | |
21 | sigstack \- set and/or get signal stack context | |
22 | .SH SYNOPSIS | |
23 | .nf | |
24 | .B #include <signal.h> | |
25 | .PP | |
26 | .B struct sigstack { | |
27 | .B caddr_t ss_sp; | |
28 | .B int ss_onstack; | |
29 | .B }; | |
30 | .PP | |
31 | .B sigstack(ss, oss); | |
32 | .B struct sigstack *ss, *oss; | |
33 | .SH DESCRIPTION | |
34 | .I Sigstack | |
35 | allows users to define an alternate stack on which signals | |
36 | are to be processed. If | |
37 | .I ss | |
38 | is non-zero, | |
39 | it specifies a | |
40 | .I "signal stack" | |
41 | on which to deliver signals | |
42 | and tells the system if the process is currently executing | |
43 | on that stack. When a signal's action indicates its handler | |
44 | should execute on the signal stack (specified with a | |
45 | .IR sigvec (2) | |
46 | call), the system checks to see | |
47 | if the process is currently executing on that stack. If the | |
48 | process is not currently executing on the signal stack, | |
49 | the system arranges a switch to the signal stack for the | |
50 | duration of the signal handler's execution. | |
51 | If | |
52 | .I oss | |
53 | is non-zero, the current signal stack state is returned. | |
54 | .SH NOTES | |
55 | Signal stacks are not ``grown'' automatically, as is | |
56 | done for the normal stack. If the stack overflows | |
57 | unpredictable results may occur. | |
58 | .SH "RETURN VALUE | |
59 | Upon successful completion, a value of 0 is returned. | |
60 | Otherwise, a value of \-1 is returned and | |
61 | .I errno | |
62 | is set to indicate the error. | |
63 | .SH ERRORS | |
64 | .I Sigstack | |
65 | will fail and the signal stack context will remain unchanged | |
66 | if one of the following occurs. | |
67 | .TP 15 | |
68 | [EFAULT] | |
69 | Either | |
70 | .I ss | |
71 | or | |
72 | .I oss | |
eff6446c | 73 | points to memory that is not a valid part of the process |
39861f6c KM |
74 | address space. |
75 | .SH "SEE ALSO" | |
76 | sigvec(2), setjmp(3) |