OSDN Git Service

LDP: Update original to LDP v3.79
[linuxjm/LDP_man-pages.git] / original / man7 / signal.7
index c4516c2..09ef95e 100644 (file)
@@ -4,6 +4,7 @@
 .\" and Copyright (c) 2008 Linux Foundation, written by Michael Kerrisk
 .\"     <mtk.manpages@gmail.com>
 .\"
+.\" %%%LICENSE_START(VERBATIM)
 .\" Permission is granted to make and distribute verbatim copies of this
 .\" manual provided the copyright notice and this permission notice are
 .\" preserved on all copies.
@@ -23,6 +24,7 @@
 .\"
 .\" Formatted or processed versions of this manual, if unaccompanied by
 .\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
 .\"
 .\" Modified Sat Jul 24 17:34:08 1993 by Rik Faith (faith@cs.unc.edu)
 .\" Modified Sun Jan  7 01:41:27 1996 by Andries Brouwer (aeb@cwi.nl)
 .\"     Added section on stop/cont signals interrupting syscalls.
 .\" 2008-10-05, mtk: various additions
 .\"
-.TH SIGNAL 7  2010-09-19 "Linux" "Linux Programmer's Manual"
+.TH SIGNAL 7  2015-02-01 "Linux" "Linux Programmer's Manual"
 .SH NAME
 signal \- overview of signals
 .SH DESCRIPTION
 Linux supports both POSIX reliable signals (hereinafter
 "standard signals") and POSIX real-time signals.
-.SS "Signal Dispositions"
+.SS Signal dispositions
 Each signal has a current
 .IR disposition ,
 which determines how the process behaves when it is delivered
@@ -100,7 +102,7 @@ During an
 .BR execve (2),
 the dispositions of handled signals are reset to the default;
 the dispositions of ignored signals are left unchanged.
-.SS Sending a Signal
+.SS Sending a signal
 The following system calls and library functions allow
 the caller to send a signal:
 .TP 16
@@ -124,9 +126,9 @@ Sends a signal to a specified thread within a specific process.
 (This is the system call used to implement
 .BR pthread_kill (3).)
 .TP
-.BR sigqueue (2)
+.BR sigqueue (3)
 Sends a real-time signal with accompanying data to a specified process.
-.SS Waiting for a Signal to be Caught
+.SS Waiting for a signal to be caught
 The following system calls suspend execution of the calling process
 or thread until a signal is caught
 (or an unhandled signal terminates the process):
@@ -137,7 +139,7 @@ Suspends execution until any signal is caught.
 .BR sigsuspend (2)
 Temporarily changes the signal mask (see below) and suspends
 execution until one of the unmasked signals is caught.
-.SS Synchronously Accepting a Signal
+.SS Synchronously accepting a signal
 Rather than asynchronously catching a signal via a signal handler,
 it is possible to synchronously accept the signal, that is,
 to block execution until the signal is delivered,
@@ -165,7 +167,7 @@ call is delivered to the caller.
 The buffer returned by
 .BR read (2)
 contains a structure describing the signal.
-.SS "Signal Mask and Pending Signals"
+.SS Signal mask and pending signals
 A signal may be
 .IR blocked ,
 which means that it will not be delivered until it is later unblocked.
@@ -217,15 +219,17 @@ A child created via
 initially has an empty pending signal set;
 the pending signal set is preserved across an
 .BR execve (2).
-.SS "Standard Signals"
+.SS Standard signals
 Linux supports the standard signals listed below.
 Several signal numbers
 are architecture-dependent, as indicated in the "Value" column.
 (Where three values are given, the first one is usually valid for
 alpha and sparc,
-the middle one for ix86, ia64, ppc, s390, arm and sh,
+the middle one for x86, arm, and most other architectures,
 and the last one for mips.
-.\" parisc is a law unto itself
+(Values for parisc are
+.I not
+shown; see the Linux kernel source for signal numbering on that architecture.)
 A \- denotes that a signal is absent on the corresponding architecture.)
 
 First the signals described in the original POSIX.1-1990 standard.
@@ -252,9 +256,9 @@ SIGUSR2     31,12,17        Term    User-defined signal 2
 SIGCHLD        20,17,18        Ign     Child stopped or terminated
 SIGCONT        19,18,25        Cont    Continue if stopped
 SIGSTOP        17,19,23        Stop    Stop process
-SIGTSTP        18,20,24        Stop    Stop typed at tty
-SIGTTIN        21,21,26        Stop    tty input for background process
-SIGTTOU        22,22,27        Stop    tty output for background process
+SIGTSTP        18,20,24        Stop    Stop typed at terminal
+SIGTTIN        21,21,26        Stop    Terminal input for background process
+SIGTTOU        22,22,27        Stop    Terminal output for background process
 .TE
 
 The signals
@@ -306,7 +310,7 @@ SIGIO       23,29,22        Term    I/O now possible (4.2BSD)
 SIGCLD \-,\-,18        Ign     A synonym for \fBSIGCHLD\fP
 SIGPWR 29,30,19        Term    Power failure (System V)
 SIGINFO        29,\-,\-                A synonym for \fBSIGPWR\fP
-SIGLOST        \-,\-,\-        Term    File lock lost
+SIGLOST        \-,\-,\-        Term    File lock lost (unused)
 SIGWINCH       28,28,20        Ign     Window resize signal (4.3BSD, Sun)
 SIGUNUSED      \-,31,\-        Core    Synonymous with \fBSIGSYS\fP
 .TE
@@ -339,7 +343,7 @@ is synonymous with
 .\" parisc is the only exception: SIGSYS is 12, SIGUNUSED is 31
 .B SIGSYS
 on most architectures.
-.SS "Real-time Signals"
+.SS Real-time signals
 Linux supports real-time signals as originally defined in the POSIX.1b
 real-time extensions (and now included in POSIX.1-2001).
 The range of supported real-time signals is defined by the macros
@@ -375,8 +379,6 @@ does not exceed
 Unlike standard signals, real-time signals have no predefined meanings:
 the entire set of real-time signals can be used for application-defined
 purposes.
-(Note, however, that the LinuxThreads implementation uses the first
-three real-time signals.)
 .PP
 The default action for an unhandled real-time signal is to terminate the
 receiving process.
@@ -388,13 +390,13 @@ By contrast, if multiple instances of a standard signal are delivered
 while that signal is currently blocked, then only one instance is queued.
 .IP 2. 4
 If the signal is sent using
-.BR sigqueue (2),
+.BR sigqueue (3),
 an accompanying value (either an integer or a pointer) can be sent
 with the signal.
 If the receiving process establishes a handler for this signal using the
 .B SA_SIGINFO
 flag to
-.BR sigaction (2)
+.BR sigaction (2),
 then it can obtain this data via the
 .I si_value
 field of the
@@ -443,7 +445,7 @@ resource limit, which specifies a per-user limit for queued
 signals; see
 .BR setrlimit (2)
 for further details.
-.SS "Async-signal-safe functions"
+.SS Async-signal-safe functions
 .PP
 A signal handler function must be very careful,
 since processing elsewhere may be interrupted
@@ -607,7 +609,7 @@ utimensat()
 utimes()
 .fi
 .in
-.SS Interruption of System Calls and Library Functions by Signal Handlers
+.SS Interruption of system calls and library functions by signal handlers
 If a signal handler is invoked while a system call or library
 function call is blocked, then either:
 .IP * 2
@@ -644,6 +646,25 @@ calls on "slow" devices.
 A "slow" device is one where the I/O call may block for an
 indefinite time, for example, a terminal, pipe, or socket.
 (A disk is not a slow device according to this definition.)
+A
+.BR read (2)
+on an
+.BR eventfd (2),
+.BR signalfd (2),
+.BR timerfd (2),
+.BR fanotify (7),
+or
+.BR inotify (7)
+file descriptor is also considered to be a "slow" operation.
+(Before Linux 3.8,
+.\" commit 1ca39ab9d21ac93f94b9e3eb364ea9a5cf2aba06
+reads from an
+.BR inotify (7)
+file descriptor were not restartable;
+when interrupted by a signal handler,
+.BR read (2)
+always failed with the error
+.BR EINTR .)
 If an I/O call on a slow device has already transferred some
 data by the time it is interrupted by a signal handler,
 then the call will return a success status
@@ -669,18 +690,24 @@ Socket interfaces:
 .BR connect (2),
 .BR recv (2),
 .BR recvfrom (2),
+.BR recvmmsg (2),
 .BR recvmsg (2),
 .BR send (2),
 .BR sendto (2),
 and
+.\" FIXME . What about sendmmsg()?
 .BR sendmsg (2),
 unless a timeout has been set on the socket (see below).
 .IP *
 File locking interfaces:
 .BR flock (2)
 and
+the
+.BR F_SETLKW
+and
+.BR F_OFD_SETLKW
+operations of
 .BR fcntl (2)
-.BR F_SETLKW .
 .IP *
 POSIX message queue interfaces:
 .BR mq_receive (3),
@@ -694,6 +721,12 @@ and
 (since Linux 2.6.22; beforehand, always failed with
 .BR EINTR ).
 .IP *
+.BR getrandom (2).
+.IP *
+.BR pthread_mutex_lock (3),
+.BR pthread_cond_wait (3),
+and related APIs.
+.IP *
 POSIX semaphore interfaces:
 .BR sem_wait (3)
 and
@@ -713,24 +746,30 @@ when interrupted by a signal handler:
 .\" on interruption by a signal handler.
 .RS 4
 .IP * 2
-Socket interfaces, when a timeout has been set on the socket using
+"Input" socket interfaces, when a timeout
+.RB ( SO_RCVTIMEO )
+has been set on the socket using
 .BR setsockopt (2):
 .BR accept (2),
 .BR recv (2),
 .BR recvfrom (2),
+.BR recvmmsg (2)
+(also with a non-NULL
+.IR timeout
+argument),
 and
-.BR recvmsg (2),
-if a receive timeout
-.RB ( SO_RCVTIMEO )
-has been set;
+.BR recvmsg (2).
+.IP *
+"Output" socket interfaces, when a timeout
+.RB ( SO_SNDTIMEO )
+has been set on the socket using
+.BR setsockopt (2):
 .BR connect (2),
 .BR send (2),
 .BR sendto (2),
 and
-.BR sendmsg (2),
-if a send timeout
-.RB ( SO_SNDTIMEO )
-has been set.
+.\" FIXME . What about sendmmsg()?
+.BR sendmsg (2).
 .IP *
 Interfaces used to wait for signals:
 .BR pause (2),
@@ -762,11 +801,6 @@ Sleep interfaces:
 and
 .BR usleep (3).
 .IP *
-.BR read (2)
-from an
-.BR inotify (7)
-file descriptor.
-.IP *
 .BR io_getevents (2).
 .RE
 .PP
@@ -774,7 +808,7 @@ The
 .BR sleep (3)
 function is also never restarted if interrupted by a handler,
 but gives a success return: the number of seconds remaining to sleep.
-.SS Interruption of System Calls and Library Functions by Stop Signals
+.SS Interruption of system calls and library functions by stop signals
 On Linux, even in the absence of signal handlers,
 certain blocking interfaces can fail with the error
 .BR EINTR
@@ -787,24 +821,30 @@ on other systems.
 The Linux interfaces that display this behavior are:
 .RS 4
 .IP * 2
-Socket interfaces, when a timeout has been set on the socket using
+"Input" socket interfaces, when a timeout
+.RB ( SO_RCVTIMEO )
+has been set on the socket using
 .BR setsockopt (2):
 .BR accept (2),
 .BR recv (2),
 .BR recvfrom (2),
+.BR recvmmsg (2)
+(also with a non-NULL
+.IR timeout
+argument),
 and
-.BR recvmsg (2),
-if a receive timeout
-.RB ( SO_RCVTIMEO )
-has been set;
+.BR recvmsg (2).
+.IP *
+"Output" socket interfaces, when a timeout
+.RB ( SO_SNDTIMEO )
+has been set on the socket using
+.BR setsockopt (2):
 .BR connect (2),
 .BR send (2),
 .BR sendto (2),
 and
-.BR sendmsg (2),
-if a send timeout
-.RB ( SO_SNDTIMEO )
-has been set.
+.\" FIXME . What about sendmmsg()?
+.BR sendmsg (2).
 .IP * 2
 .BR epoll_wait (2),
 .BR epoll_pwait (2).
@@ -815,6 +855,8 @@ has been set.
 .BR sigtimedwait (2),
 .BR sigwaitinfo (2).
 .IP *
+Linux 3.7 and earlier:
+.\" commit 1ca39ab9d21ac93f94b9e3eb364ea9a5cf2aba06
 .BR read (2)
 from an
 .BR inotify (7)
@@ -833,22 +875,25 @@ Linux 2.6.8 and earlier:
 Linux 2.4 and earlier:
 .BR nanosleep (2).
 .RE
-.SH "CONFORMING TO"
+.SH CONFORMING TO
 POSIX.1, except as noted.
-.SH BUGS
-.B SIGIO
-and
-.B SIGLOST
-have the same value.
-The latter is commented out in the kernel source, but
-the build process of some software still thinks that
-signal 29 is
-.BR SIGLOST .
-.SH "SEE ALSO"
+.\" It must be a *very* long time since this was true:
+.\" .SH BUGS
+.\" .B SIGIO
+.\" and
+.\" .B SIGLOST
+.\" have the same value.
+.\" The latter is commented out in the kernel source, but
+.\" the build process of some software still thinks that
+.\" signal 29 is
+.\" .BR SIGLOST .
+.SH SEE ALSO
 .BR kill (1),
 .BR getrlimit (2),
 .BR kill (2),
 .BR killpg (2),
+.BR restart_syscall (2),
+.BR rt_sigqueueinfo (2),
 .BR setitimer (2),
 .BR setrlimit (2),
 .BR sgetmask (2),
@@ -858,7 +903,7 @@ signal 29 is
 .BR signalfd (2),
 .BR sigpending (2),
 .BR sigprocmask (2),
-.BR sigqueue (2),
+.BR sigreturn (2),
 .BR sigsuspend (2),
 .BR sigwaitinfo (2),
 .BR abort (3),
@@ -866,6 +911,7 @@ signal 29 is
 .BR longjmp (3),
 .BR raise (3),
 .BR pthread_sigqueue (3),
+.BR sigqueue (3),
 .BR sigset (3),
 .BR sigsetops (3),
 .BR sigvec (3),
@@ -876,3 +922,12 @@ signal 29 is
 .BR proc (5),
 .BR pthreads (7),
 .BR sigevent (7)
+.SH COLOPHON
+This page is part of release 3.79 of the Linux
+.I man-pages
+project.
+A description of the project,
+information about reporting bugs,
+and the latest version of this page,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.