]>
Commit | Line | Data |
---|---|---|
a1eaacb1 | 1 | '\" t |
fea681da MK |
2 | .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) |
3 | .\" | |
5fbde956 | 4 | .\" SPDX-License-Identifier: Linux-man-pages-copyleft |
fea681da MK |
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) | |
4c1c5274 | 12 | .TH siginterrupt 3 (date) "Linux man-pages (unreleased)" |
fea681da MK |
13 | .SH NAME |
14 | siginterrupt \- allow signals to interrupt system calls | |
467f314e AC |
15 | .SH LIBRARY |
16 | Standard C library | |
8fc3b2cf | 17 | .RI ( libc ", " \-lc ) |
fea681da MK |
18 | .SH SYNOPSIS |
19 | .nf | |
20 | .B #include <signal.h> | |
c6d039a3 | 21 | .P |
4131356c | 22 | .BI "[[deprecated]] int siginterrupt(int " sig ", int " flag ); |
fea681da | 23 | .fi |
c6d039a3 | 24 | .P |
d39ad78f | 25 | .RS -4 |
cc4615cc MK |
26 | Feature Test Macro Requirements for glibc (see |
27 | .BR feature_test_macros (7)): | |
d39ad78f | 28 | .RE |
c6d039a3 | 29 | .P |
cc4615cc | 30 | .BR siginterrupt (): |
9d2adbae | 31 | .nf |
5c10d2c5 MK |
32 | _XOPEN_SOURCE >= 500 |
33 | .\" || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED | |
34 | || /* Since glibc 2.12: */ _POSIX_C_SOURCE >= 200809L | |
75c018a1 | 35 | || /* glibc <= 2.19: */ _BSD_SOURCE |
9d2adbae | 36 | .fi |
fea681da | 37 | .SH DESCRIPTION |
60a90ecd MK |
38 | The |
39 | .BR siginterrupt () | |
d9bfdb9c | 40 | function changes the restart behavior when |
c13182ef MK |
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. | |
d9bfdb9c | 45 | This is the default behavior in Linux. |
c6d039a3 | 46 | .P |
055e4eb7 | 47 | If the \fIflag\fP argument is true (1) and no data has been transferred, |
fea681da | 48 | then a system call interrupted by the signal \fIsig\fP will return \-1 |
28d03ce9 | 49 | and \fIerrno\fP will be set to |
055e4eb7 | 50 | .BR EINTR . |
c6d039a3 | 51 | .P |
055e4eb7 | 52 | If the \fIflag\fP argument is true (1) and data transfer has started, |
fea681da MK |
53 | then the system call will be interrupted and will return the actual |
54 | amount of data transferred. | |
47297adb | 55 | .SH RETURN VALUE |
60a90ecd MK |
56 | The |
57 | .BR siginterrupt () | |
d82911be | 58 | function returns 0 on success. |
433356dc MK |
59 | It returns \-1 if the |
60 | signal number | |
61 | .I sig | |
62 | is invalid, with | |
63 | .I errno | |
855d489a | 64 | set to indicate the error. |
fea681da MK |
65 | .SH ERRORS |
66 | .TP | |
67 | .B EINVAL | |
68 | The specified signal number is invalid. | |
5575c22f | 69 | .SH ATTRIBUTES |
8272c761 PH |
70 | For an explanation of the terms used in this section, see |
71 | .BR attributes (7). | |
72 | .TS | |
73 | allbox; | |
b32feea5 | 74 | lb lb lbx |
8272c761 PH |
75 | l l l. |
76 | Interface Attribute Value | |
77 | T{ | |
9e54434e BR |
78 | .na |
79 | .nh | |
5575c22f | 80 | .BR siginterrupt () |
b32feea5 | 81 | T} Thread safety T{ |
9e54434e BR |
82 | .na |
83 | .nh | |
b32feea5 MK |
84 | MT-Unsafe const:sigintr |
85 | T} | |
8272c761 | 86 | .TE |
3113c7f3 | 87 | .SH STANDARDS |
4131356c AC |
88 | POSIX.1-2008. |
89 | .SH HISTORY | |
68e1685c | 90 | 4.3BSD, POSIX.1-2001. |
4131356c AC |
91 | Obsolete in POSIX.1-2008, |
92 | recommending the use of | |
0ae4b67f MK |
93 | .BR sigaction (2) |
94 | with the | |
95 | .B SA_RESTART | |
96 | flag instead. | |
47297adb | 97 | .SH SEE ALSO |
fea681da | 98 | .BR signal (2) |