new quota system
[unix-history] / usr / src / lib / libc / sys / sigreturn.2
CommitLineData
88b3ccf2
KB
1.\" Copyright (c) 1985 The Regents of the University of California.
2.\" All rights reserved.
6decfcd4 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.\" @(#)sigreturn.2 6.3 (Berkeley) %G%
6decfcd4
KM
17.\"
18.TH SIGRETURN 2 ""
19.UC 6
20.SH NAME
21sigreturn \- return from signal
22.SH SYNOPSIS
23.nf
24.B #include <signal.h>
25.PP
26.B struct sigcontext {
27.B int sc_onstack;
28.B int sc_mask;
29.B int sc_sp;
30.B int sc_fp;
31.B int sc_ap;
32.B int sc_pc;
33.B int sc_ps;
34.B };
35.PP
36.B sigreturn(scp);
37.B struct sigcontext *scp;
38.SH DESCRIPTION
39.I Sigreturn
40allows users to atomically unmask, switch stacks,
41and return from a signal context.
42The processes signal mask and stack status are
43restored from the context.
44The system call does not return;
45the users stack pointer, frame pointer, argument pointer,
46and processor status longword are restored from the context.
47Execution resumes at the specified pc.
48This system call is used by the trampoline code, and
49.IR longjmp (3)
50when returning from a signal to the previously executing program.
51.SH NOTES
52This system call is not available in 4.2BSD,
53hence it should not be used if backward compatibility is needed.
54.SH "RETURN VALUE
55If successful, the system call does not return.
56Otherwise, a value of \-1 is returned and
57.I errno
58is set to indicate the error.
59.SH ERRORS
60.I Sigreturn
61will fail and the process context will remain unchanged
62if one of the following occurs.
63.TP 15
64[EFAULT]
65.I Scp
eff6446c 66points to memory that is not a valid part of the process
6decfcd4
KM
67address space.
68.TP
69[EINVAL]
70The process status longword is invalid or would improperly
71raise the privilege level of the process.
72.SH "SEE ALSO"
73sigvec(2), setjmp(3)