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(): _BSD_SOURCE || _XOPEN_SOURCE >= 500
16
18 The siginterrupt() function changes the restart behavior when a system
19 call is interrupted by the signal sig. If the flag argument is false
20 (0), then system calls will be restarted if interrupted by the speci‐
21 fied signal sig. This is the default behavior in Linux. However, when
22 a new signal handler is specified with the signal(2) function, the sys‐
23 tem call is interrupted by default.
24
25 If the flag argument is true (1) and no data has been transferred, then
26 a system call interrupted by the signal sig will return -1 and errno
27 will be set to EINTR.
28
29 If the flag argument is true (1) and data transfer has started, then
30 the system call will be interrupted and will return the actual amount
31 of data transferred.
32
34 The siginterrupt() function returns 0 on success, or -1 if the signal
35 number sig is invalid.
36
38 EINVAL The specified signal number is invalid.
39
41 4.3BSD, POSIX.1-2001. POSIX.1-2008 marks siginterrupt() as obsolete,
42 recommending the use of sigaction(2) with the SA_RESTART flag instead.
43
45 signal(2)
46
48 This page is part of release 3.22 of the Linux man-pages project. A
49 description of the project, and information about reporting bugs, can
50 be found at http://www.kernel.org/doc/man-pages/.
51
52
53
54 2009-03-15 SIGINTERRUPT(3)