OSDN Git Service

(split) Import translated manuals from JM CVS Repository.
[linuxjm/LDP_man-pages.git] / original / man2 / sigreturn.2
1 .\" Copyright (C) 1995, Thomas K. Dyas <tdyas@eden.rutgers.edu>
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" Created   Sat Aug 21 1995     Thomas K. Dyas <tdyas@eden.rutgers.edu>
24 .\" Modified Tue Oct 22 22:09:03 1996 by Eric S. Raymond <esr@thyrsus.com>
25 .\" 2008-06-26, mtk, added some more detail on the work done by sigreturn()
26 .\"
27 .TH SIGRETURN 2 2008-06-26 "Linux" "Linux Programmer's Manual"
28 .SH NAME
29 sigreturn \- return from signal handler and cleanup stack frame
30 .SH SYNOPSIS
31 .BI "int sigreturn(unsigned long " __unused );
32 .SH DESCRIPTION
33 When the Linux kernel creates the stack frame for a signal handler, a
34 call to
35 .BR sigreturn ()
36 is inserted into the stack frame so that upon
37 return from the signal handler,
38 .BR sigreturn ()
39 will be called.
40
41 This
42 .BR sigreturn ()
43 call undoes everything that was
44 done\(emchanging the process's signal mask, switching stacks (see
45 .BR sigaltstack "(2))\(emin "
46 order to invoke the signal handler:
47 it restores the process's signal mask, switches stacks,
48 and restores the process's context (registers, processor flags),
49 so that the process directly resumes execution
50 at the point where it was interrupted by the signal.
51 .SH "RETURN VALUE"
52 .BR sigreturn ()
53 never returns.
54 .SH FILES
55 /usr/src/linux/arch/i386/kernel/signal.c
56 .br
57 /usr/src/linux/arch/alpha/kernel/entry.S
58 .SH "CONFORMING TO"
59 .BR sigreturn ()
60 is specific to Linux and should not be used in programs intended to be
61 portable.
62 .SH NOTES
63 The
64 .BR sigreturn ()
65 call is used by the kernel to implement signal handlers.
66 It should
67 .B never
68 be called directly.
69 Better yet, the specific use of the
70 .I __unused
71 argument varies depending on the architecture.
72 .SH "SEE ALSO"
73 .BR kill (2),
74 .BR sigaltstack (2),
75 .BR signal (2),
76 .BR signal (7)