OSDN Git Service

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