.\" Added section on stop/cont signals interrupting syscalls.
.\" 2008-10-05, mtk: various additions
.\"
-.TH SIGNAL 7 2012-05-01 "Linux" "Linux Programmer's Manual"
+.TH SIGNAL 7 2015-02-01 "Linux" "Linux Programmer's Manual"
.SH NAME
signal \- overview of signals
.SH DESCRIPTION
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
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
.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),
(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
.\" 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),
and
.BR usleep (3).
.IP *
-.BR read (2)
-from an
-.BR inotify (7)
-file descriptor.
-.IP *
.BR io_getevents (2).
.RE
.PP
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).
.BR sigtimedwait (2),
.BR sigwaitinfo (2).
.IP *
+Linux 3.7 and earlier:
+.\" commit 1ca39ab9d21ac93f94b9e3eb364ea9a5cf2aba06
.BR read (2)
from an
.BR inotify (7)
.BR getrlimit (2),
.BR kill (2),
.BR killpg (2),
+.BR restart_syscall (2),
.BR rt_sigqueueinfo (2),
.BR setitimer (2),
.BR setrlimit (2),
.BR signalfd (2),
.BR sigpending (2),
.BR sigprocmask (2),
+.BR sigreturn (2),
.BR sigsuspend (2),
.BR sigwaitinfo (2),
.BR abort (3),
.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/.