]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/siginterrupt.3
Many pages: Add '\" t' comment where necessary
[thirdparty/man-pages.git] / man3 / siginterrupt.3
1 '\" t
2 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
3 .\"
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
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)
12 .TH siginterrupt 3 (date) "Linux man-pages (unreleased)"
13 .SH NAME
14 siginterrupt \- allow signals to interrupt system calls
15 .SH LIBRARY
16 Standard C library
17 .RI ( libc ", " \-lc )
18 .SH SYNOPSIS
19 .nf
20 .B #include <signal.h>
21 .PP
22 .BI "int siginterrupt(int " sig ", int " flag );
23 .fi
24 .PP
25 .RS -4
26 Feature Test Macro Requirements for glibc (see
27 .BR feature_test_macros (7)):
28 .RE
29 .PP
30 .BR siginterrupt ():
31 .nf
32 _XOPEN_SOURCE >= 500
33 .\" || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED
34 || /* Since glibc 2.12: */ _POSIX_C_SOURCE >= 200809L
35 || /* Glibc <= 2.19: */ _BSD_SOURCE
36 .fi
37 .SH DESCRIPTION
38 The
39 .BR siginterrupt ()
40 function changes the restart behavior when
41 a system call is interrupted by the signal \fIsig\fP.
42 If the \fIflag\fP
43 argument is false (0), then system calls will be restarted if interrupted
44 by the specified signal \fIsig\fP.
45 This is the default behavior in Linux.
46 .PP
47 If the \fIflag\fP argument is true (1) and no data has been transferred,
48 then a system call interrupted by the signal \fIsig\fP will return \-1
49 and \fIerrno\fP will be set to
50 .BR EINTR .
51 .PP
52 If the \fIflag\fP argument is true (1) and data transfer has started,
53 then the system call will be interrupted and will return the actual
54 amount of data transferred.
55 .SH RETURN VALUE
56 The
57 .BR siginterrupt ()
58 function returns 0 on success.
59 It returns \-1 if the
60 signal number
61 .I sig
62 is invalid, with
63 .I errno
64 set to indicate the error.
65 .SH ERRORS
66 .TP
67 .B EINVAL
68 The specified signal number is invalid.
69 .SH ATTRIBUTES
70 For an explanation of the terms used in this section, see
71 .BR attributes (7).
72 .ad l
73 .nh
74 .TS
75 allbox;
76 lb lb lbx
77 l l l.
78 Interface Attribute Value
79 T{
80 .BR siginterrupt ()
81 T} Thread safety T{
82 MT-Unsafe const:sigintr
83 T}
84 .TE
85 .hy
86 .ad
87 .sp 1
88 .SH STANDARDS
89 4.3BSD, POSIX.1-2001.
90 POSIX.1-2008 marks
91 .BR siginterrupt ()
92 as obsolete, recommending the use of
93 .BR sigaction (2)
94 with the
95 .B SA_RESTART
96 flag instead.
97 .SH SEE ALSO
98 .BR signal (2)