]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/siginterrupt.3
man*/: srcfix (Use .P instead of .PP or .LP)
[thirdparty/man-pages.git] / man3 / siginterrupt.3
CommitLineData
a1eaacb1 1'\" t
fea681da
MK
2.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
3.\"
5fbde956 4.\" SPDX-License-Identifier: Linux-man-pages-copyleft
fea681da
MK
5.\"
6.\" References consulted:
7.\" Linux libc source code
8.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
9.\" 386BSD man pages
10.\" Modified Sun Jul 25 10:40:51 1993 by Rik Faith (faith@cs.unc.edu)
11.\" Modified Sun Apr 14 16:20:34 1996 by Andries Brouwer (aeb@cwi.nl)
4c1c5274 12.TH siginterrupt 3 (date) "Linux man-pages (unreleased)"
fea681da
MK
13.SH NAME
14siginterrupt \- allow signals to interrupt system calls
467f314e
AC
15.SH LIBRARY
16Standard C library
8fc3b2cf 17.RI ( libc ", " \-lc )
fea681da
MK
18.SH SYNOPSIS
19.nf
20.B #include <signal.h>
c6d039a3 21.P
4131356c 22.BI "[[deprecated]] int siginterrupt(int " sig ", int " flag );
fea681da 23.fi
c6d039a3 24.P
d39ad78f 25.RS -4
cc4615cc
MK
26Feature Test Macro Requirements for glibc (see
27.BR feature_test_macros (7)):
d39ad78f 28.RE
c6d039a3 29.P
cc4615cc 30.BR siginterrupt ():
9d2adbae 31.nf
5c10d2c5
MK
32 _XOPEN_SOURCE >= 500
33.\" || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED
34 || /* Since glibc 2.12: */ _POSIX_C_SOURCE >= 200809L
75c018a1 35 || /* glibc <= 2.19: */ _BSD_SOURCE
9d2adbae 36.fi
fea681da 37.SH DESCRIPTION
60a90ecd
MK
38The
39.BR siginterrupt ()
d9bfdb9c 40function changes the restart behavior when
c13182ef
MK
41a system call is interrupted by the signal \fIsig\fP.
42If the \fIflag\fP
43argument is false (0), then system calls will be restarted if interrupted
44by the specified signal \fIsig\fP.
d9bfdb9c 45This is the default behavior in Linux.
c6d039a3 46.P
055e4eb7 47If the \fIflag\fP argument is true (1) and no data has been transferred,
fea681da 48then a system call interrupted by the signal \fIsig\fP will return \-1
28d03ce9 49and \fIerrno\fP will be set to
055e4eb7 50.BR EINTR .
c6d039a3 51.P
055e4eb7 52If the \fIflag\fP argument is true (1) and data transfer has started,
fea681da
MK
53then the system call will be interrupted and will return the actual
54amount of data transferred.
47297adb 55.SH RETURN VALUE
60a90ecd
MK
56The
57.BR siginterrupt ()
d82911be 58function returns 0 on success.
433356dc
MK
59It returns \-1 if the
60signal number
61.I sig
62is invalid, with
63.I errno
855d489a 64set to indicate the error.
fea681da
MK
65.SH ERRORS
66.TP
67.B EINVAL
68The specified signal number is invalid.
5575c22f 69.SH ATTRIBUTES
8272c761
PH
70For an explanation of the terms used in this section, see
71.BR attributes (7).
72.TS
73allbox;
b32feea5 74lb lb lbx
8272c761
PH
75l l l.
76Interface Attribute Value
77T{
9e54434e
BR
78.na
79.nh
5575c22f 80.BR siginterrupt ()
b32feea5 81T} Thread safety T{
9e54434e
BR
82.na
83.nh
b32feea5
MK
84MT-Unsafe const:sigintr
85T}
8272c761 86.TE
3113c7f3 87.SH STANDARDS
4131356c
AC
88POSIX.1-2008.
89.SH HISTORY
68e1685c 904.3BSD, POSIX.1-2001.
4131356c
AC
91Obsolete in POSIX.1-2008,
92recommending the use of
0ae4b67f
MK
93.BR sigaction (2)
94with the
95.B SA_RESTART
96flag instead.
47297adb 97.SH SEE ALSO
fea681da 98.BR signal (2)