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