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