Debian Codegraph @

upstream/debian-unstable/man3/siginterrupt.3

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