Commit | Line | Data |
---|---|---|
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 | |
21 | sigreturn \- 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 | |
40 | allows users to atomically unmask, switch stacks, | |
41 | and return from a signal context. | |
42 | The processes signal mask and stack status are | |
43 | restored from the context. | |
44 | The system call does not return; | |
45 | the users stack pointer, frame pointer, argument pointer, | |
46 | and processor status longword are restored from the context. | |
47 | Execution resumes at the specified pc. | |
48 | This system call is used by the trampoline code, and | |
49 | .IR longjmp (3) | |
50 | when returning from a signal to the previously executing program. | |
51 | .SH NOTES | |
52 | This system call is not available in 4.2BSD, | |
53 | hence it should not be used if backward compatibility is needed. | |
54 | .SH "RETURN VALUE | |
55 | If successful, the system call does not return. | |
56 | Otherwise, a value of \-1 is returned and | |
57 | .I errno | |
58 | is set to indicate the error. | |
59 | .SH ERRORS | |
60 | .I Sigreturn | |
61 | will fail and the process context will remain unchanged | |
62 | if one of the following occurs. | |
63 | .TP 15 | |
64 | [EFAULT] | |
65 | .I Scp | |
eff6446c | 66 | points to memory that is not a valid part of the process |
6decfcd4 KM |
67 | address space. |
68 | .TP | |
69 | [EINVAL] | |
70 | The process status longword is invalid or would improperly | |
71 | raise the privilege level of the process. | |
72 | .SH "SEE ALSO" | |
73 | sigvec(2), setjmp(3) |