1SIGRETURN(2)               Linux Programmer's Manual              SIGRETURN(2)
2
3
4

NAME

6       sigreturn - return from signal handler and cleanup stack frame
7

SYNOPSIS

9       int sigreturn(unsigned long __unused);
10

DESCRIPTION

12       When  the  Linux kernel creates the stack frame for a signal handler, a
13       call to sigreturn() is inserted into  the  stack  frame  so  that  upon
14       return from the signal handler, sigreturn() will be called.
15
16       This  sigreturn()  call  undoes  everything  that was done—changing the
17       process's signal mask, switching stacks (see  sigaltstack(2))—in  order
18       to  invoke  the  signal handler: it restores the process's signal mask,
19       switches stacks, and restores the process's context (registers, proces‐
20       sor flags), so that the process directly resumes execution at the point
21       where it was interrupted by the signal.
22

RETURN VALUE

24       sigreturn() never returns.
25

FILES

27       /usr/src/linux/arch/i386/kernel/signal.c
28       /usr/src/linux/arch/alpha/kernel/entry.S
29

CONFORMING TO

31       sigreturn() is specific to Linux and should not  be  used  in  programs
32       intended to be portable.
33

NOTES

35       The  sigreturn()  call  is  used by the kernel to implement signal han‐
36       dlers.  It should never be called directly.  Better yet,  the  specific
37       use of the __unused argument varies depending on the architecture.
38

SEE ALSO

40       kill(2), restart_syscall(2), sigaltstack(2), signal(2), signal(7)
41

COLOPHON

43       This  page  is  part of release 3.53 of the Linux man-pages project.  A
44       description of the project, and information about reporting  bugs,  can
45       be found at http://www.kernel.org/doc/man-pages/.
46
47
48
49Linux                             2013-07-30                      SIGRETURN(2)
Impressum