BSD 4_3_Tahoe release
[unix-history] / usr / src / man / man2 / sigstack.2
CommitLineData
39861f6c
KM
1.\" Copyright (c) 1983 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
95f51977 5.\" @(#)sigstack.2 6.2 (Berkeley) 6/30/85
39861f6c 6.\"
95f51977 7.TH SIGSTACK 2 "June 30, 1985"
39861f6c
KM
8.UC 5
9.SH NAME
10sigstack \- set and/or get signal stack context
11.SH SYNOPSIS
12.nf
13.B #include <signal.h>
14.PP
15.B struct sigstack {
16.B caddr_t ss_sp;
17.B int ss_onstack;
18.B };
19.PP
20.B sigstack(ss, oss);
21.B struct sigstack *ss, *oss;
22.SH DESCRIPTION
23.I Sigstack
24allows users to define an alternate stack on which signals
25are to be processed. If
26.I ss
27is non-zero,
28it specifies a
29.I "signal stack"
30on which to deliver signals
31and tells the system if the process is currently executing
32on that stack. When a signal's action indicates its handler
33should execute on the signal stack (specified with a
34.IR sigvec (2)
35call), the system checks to see
36if the process is currently executing on that stack. If the
37process is not currently executing on the signal stack,
38the system arranges a switch to the signal stack for the
39duration of the signal handler's execution.
40If
41.I oss
42is non-zero, the current signal stack state is returned.
43.SH NOTES
44Signal stacks are not ``grown'' automatically, as is
45done for the normal stack. If the stack overflows
46unpredictable results may occur.
47.SH "RETURN VALUE
48Upon successful completion, a value of 0 is returned.
49Otherwise, a value of \-1 is returned and
50.I errno
51is set to indicate the error.
52.SH ERRORS
53.I Sigstack
54will fail and the signal stack context will remain unchanged
55if one of the following occurs.
56.TP 15
57[EFAULT]
58Either
59.I ss
60or
61.I oss
eff6446c 62points to memory that is not a valid part of the process
39861f6c
KM
63address space.
64.SH "SEE ALSO"
65sigvec(2), setjmp(3)