Commit | Line | Data |
---|---|---|
6decfcd4 KM |
1 | .\" Copyright (c) 1985 Regents of the University of California. |
2 | .\" All rights reserved. The Berkeley software License Agreement | |
3 | .\" specifies the terms and conditions for redistribution. | |
4 | .\" | |
5 | .\" @(#)sigreturn.2 6.1 (Berkeley) %G% | |
6 | .\" | |
7 | .TH SIGRETURN 2 "" | |
8 | .UC 6 | |
9 | .SH NAME | |
10 | sigreturn \- return from signal | |
11 | .SH SYNOPSIS | |
12 | .nf | |
13 | .B #include <signal.h> | |
14 | .PP | |
15 | .B struct sigcontext { | |
16 | .B int sc_onstack; | |
17 | .B int sc_mask; | |
18 | .B int sc_sp; | |
19 | .B int sc_fp; | |
20 | .B int sc_ap; | |
21 | .B int sc_pc; | |
22 | .B int sc_ps; | |
23 | .B }; | |
24 | .PP | |
25 | .B sigreturn(scp); | |
26 | .B struct sigcontext *scp; | |
27 | .SH DESCRIPTION | |
28 | .I Sigreturn | |
29 | allows users to atomically unmask, switch stacks, | |
30 | and return from a signal context. | |
31 | The processes signal mask and stack status are | |
32 | restored from the context. | |
33 | The system call does not return; | |
34 | the users stack pointer, frame pointer, argument pointer, | |
35 | and processor status longword are restored from the context. | |
36 | Execution resumes at the specified pc. | |
37 | This system call is used by the trampoline code, and | |
38 | .IR longjmp (3) | |
39 | when returning from a signal to the previously executing program. | |
40 | .SH NOTES | |
41 | This system call is not available in 4.2BSD, | |
42 | hence it should not be used if backward compatibility is needed. | |
43 | .SH "RETURN VALUE | |
44 | If successful, the system call does not return. | |
45 | Otherwise, a value of \-1 is returned and | |
46 | .I errno | |
47 | is set to indicate the error. | |
48 | .SH ERRORS | |
49 | .I Sigreturn | |
50 | will fail and the process context will remain unchanged | |
51 | if one of the following occurs. | |
52 | .TP 15 | |
53 | [EFAULT] | |
54 | .I Scp | |
55 | points to memory which is not a valid part of the process | |
56 | address space. | |
57 | .TP | |
58 | [EINVAL] | |
59 | The process status longword is invalid or would improperly | |
60 | raise the privilege level of the process. | |
61 | .SH "SEE ALSO" | |
62 | sigvec(2), setjmp(3) |