1siginterrupt(3)            Library Functions Manual            siginterrupt(3)
2
3
4

NAME

6       siginterrupt - allow signals to interrupt system calls
7

LIBRARY

9       Standard C library (libc, -lc)
10

SYNOPSIS

12       #include <signal.h>
13
14       [[deprecated]] int siginterrupt(int sig, int flag);
15
16   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
17
18       siginterrupt():
19           _XOPEN_SOURCE >= 500
20               || /* Since glibc 2.12: */ _POSIX_C_SOURCE >= 200809L
21               || /* glibc <= 2.19: */ _BSD_SOURCE
22

DESCRIPTION

24       The  siginterrupt() function changes the restart behavior when a system
25       call is interrupted by the signal sig.  If the flag argument  is  false
26       (0),  then  system calls will be restarted if interrupted by the speci‐
27       fied signal sig.  This is the default behavior in Linux.
28
29       If the flag argument is true (1) and no data has been transferred, then
30       a  system  call  interrupted by the signal sig will return -1 and errno
31       will be set to EINTR.
32
33       If the flag argument is true (1) and data transfer  has  started,  then
34       the  system  call will be interrupted and will return the actual amount
35       of data transferred.
36

RETURN VALUE

38       The siginterrupt() function returns 0 on success.  It returns -1 if the
39       signal number sig is invalid, with errno set to indicate the error.
40

ERRORS

42       EINVAL The specified signal number is invalid.
43

ATTRIBUTES

45       For  an  explanation  of  the  terms  used  in  this  section,  see at‐
46       tributes(7).
47
48       ┌───────────────┬───────────────┬──────────────────────────────────────┐
49Interface      Attribute     Value                                
50       ├───────────────┼───────────────┼──────────────────────────────────────┤
51siginterrupt() │ Thread safety │ MT-Unsafe const:sigintr              │
52       └───────────────┴───────────────┴──────────────────────────────────────┘
53

STANDARDS

55       POSIX.1-2008.
56

HISTORY

58       4.3BSD, POSIX.1-2001.  Obsolete in POSIX.1-2008, recommending  the  use
59       of sigaction(2) with the SA_RESTART flag instead.
60

SEE ALSO

62       signal(2)
63
64
65
66Linux man-pages 6.05              2023-07-20                   siginterrupt(3)
Impressum