1SIGINTERRUPT(3) Linux Programmer's Manual SIGINTERRUPT(3)
2
3
4
6 siginterrupt - allow signals to interrupt system calls
7
9 #include <signal.h>
10
11 int siginterrupt(int sig, int flag);
12
13 Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
14
15 siginterrupt():
16 _XOPEN_SOURCE >= 500
17 || /* Since glibc 2.12: */ _POSIX_C_SOURCE >= 200809L
18 || /* Glibc <= 2.19: */ _BSD_SOURCE
19
21 The siginterrupt() function changes the restart behavior when a system
22 call is interrupted by the signal sig. If the flag argument is false
23 (0), then system calls will be restarted if interrupted by the speci‐
24 fied signal sig. This is the default behavior in Linux.
25
26 If the flag argument is true (1) and no data has been transferred, then
27 a system call interrupted by the signal sig will return -1 and errno
28 will be set to EINTR.
29
30 If the flag argument is true (1) and data transfer has started, then
31 the system call will be interrupted and will return the actual amount
32 of data transferred.
33
35 The siginterrupt() function returns 0 on success. It returns -1 if the
36 signal number sig is invalid, with errno set to indicate the error.
37
39 EINVAL The specified signal number is invalid.
40
42 For an explanation of the terms used in this section, see at‐
43 tributes(7).
44
45 ┌───────────────┬───────────────┬──────────────────────────────────────┐
46 │Interface │ Attribute │ Value │
47 ├───────────────┼───────────────┼──────────────────────────────────────┤
48 │siginterrupt() │ Thread safety │ MT-Unsafe const:sigintr │
49 └───────────────┴───────────────┴──────────────────────────────────────┘
50
52 4.3BSD, POSIX.1-2001. POSIX.1-2008 marks siginterrupt() as obsolete,
53 recommending the use of sigaction(2) with the SA_RESTART flag instead.
54
56 signal(2)
57
59 This page is part of release 5.13 of the Linux man-pages project. A
60 description of the project, information about reporting bugs, and the
61 latest version of this page, can be found at
62 https://www.kernel.org/doc/man-pages/.
63
64
65
66 2021-03-22 SIGINTERRUPT(3)