]>
Commit | Line | Data |
---|---|---|
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 |
13 | siginterrupt \- allow signals to interrupt system calls | |
467f314e AC |
14 | .SH LIBRARY |
15 | Standard 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 |
25 | Feature 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 |
37 | The |
38 | .BR siginterrupt () | |
d9bfdb9c | 39 | function changes the restart behavior when |
c13182ef MK |
40 | a system call is interrupted by the signal \fIsig\fP. |
41 | If the \fIflag\fP | |
42 | argument is false (0), then system calls will be restarted if interrupted | |
43 | by the specified signal \fIsig\fP. | |
d9bfdb9c | 44 | This is the default behavior in Linux. |
fea681da | 45 | .PP |
055e4eb7 | 46 | If the \fIflag\fP argument is true (1) and no data has been transferred, |
fea681da | 47 | then a system call interrupted by the signal \fIsig\fP will return \-1 |
28d03ce9 | 48 | and \fIerrno\fP will be set to |
055e4eb7 | 49 | .BR EINTR . |
fea681da | 50 | .PP |
055e4eb7 | 51 | If the \fIflag\fP argument is true (1) and data transfer has started, |
fea681da MK |
52 | then the system call will be interrupted and will return the actual |
53 | amount of data transferred. | |
47297adb | 54 | .SH RETURN VALUE |
60a90ecd MK |
55 | The |
56 | .BR siginterrupt () | |
d82911be | 57 | function returns 0 on success. |
433356dc MK |
58 | It returns \-1 if the |
59 | signal number | |
60 | .I sig | |
61 | is invalid, with | |
62 | .I errno | |
855d489a | 63 | set to indicate the error. |
fea681da MK |
64 | .SH ERRORS |
65 | .TP | |
66 | .B EINVAL | |
67 | The specified signal number is invalid. | |
5575c22f | 68 | .SH ATTRIBUTES |
8272c761 PH |
69 | For 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 |
74 | allbox; | |
b32feea5 | 75 | lb lb lbx |
8272c761 PH |
76 | l l l. |
77 | Interface Attribute Value | |
78 | T{ | |
5575c22f | 79 | .BR siginterrupt () |
b32feea5 MK |
80 | T} Thread safety T{ |
81 | MT-Unsafe const:sigintr | |
82 | T} | |
8272c761 | 83 | .TE |
c466875e MK |
84 | .hy |
85 | .ad | |
86 | .sp 1 | |
3113c7f3 | 87 | .SH STANDARDS |
68e1685c | 88 | 4.3BSD, POSIX.1-2001. |
4b8234be MK |
89 | POSIX.1-2008 marks |
90 | .BR siginterrupt () | |
0ae4b67f MK |
91 | as obsolete, recommending the use of |
92 | .BR sigaction (2) | |
93 | with the | |
94 | .B SA_RESTART | |
95 | flag instead. | |
47297adb | 96 | .SH SEE ALSO |
fea681da | 97 | .BR signal (2) |