1SIGINTERRUPT(3P)           POSIX Programmer's Manual          SIGINTERRUPT(3P)
2
3
4

PROLOG

6       This  manual  page is part of the POSIX Programmer's Manual.  The Linux
7       implementation of this interface may differ (consult the  corresponding
8       Linux  manual page for details of Linux behavior), or the interface may
9       not be implemented on Linux.
10

NAME

12       siginterrupt — allow signals to interrupt functions
13

SYNOPSIS

15       #include <signal.h>
16
17       int siginterrupt(int sig, int flag);
18

DESCRIPTION

20       The siginterrupt() function shall change the restart  behavior  when  a
21       function is interrupted by the specified signal. The function siginter‐
22       rupt(sig, flag) has an effect as if implemented as:
23
24
25           int siginterrupt(int sig, int flag) {
26               int ret;
27               struct sigaction act;
28
29               (void) sigaction(sig, NULL, &act);
30               if (flag)
31                   act.sa_flags &= ~SA_RESTART;
32               else
33                   act.sa_flags |= SA_RESTART;
34               ret = sigaction(sig, &act, NULL);
35               return ret;
36           }
37

RETURN VALUE

39       Upon successful completion, siginterrupt() shall return  0;  otherwise,
40       -1 shall be returned and errno set to indicate the error.
41

ERRORS

43       The siginterrupt() function shall fail if:
44
45       EINVAL The sig argument is not a valid signal number.
46
47       The following sections are informative.
48

EXAMPLES

50       None.
51

APPLICATION USAGE

53       The  siginterrupt()  function  supports  programs written to historical
54       system interfaces.  Applications should use the  sigaction()  with  the
55       SA_RESTART flag instead of the obsolescent siginterrupt() function.
56

RATIONALE

58       None.
59

FUTURE DIRECTIONS

61       None.
62

SEE ALSO

64       Section 2.4, Signal Concepts, sigaction()
65
66       The Base Definitions volume of POSIX.1‐2017, <signal.h>
67
69       Portions  of  this text are reprinted and reproduced in electronic form
70       from IEEE Std 1003.1-2017, Standard for Information Technology --  Por‐
71       table  Operating System Interface (POSIX), The Open Group Base Specifi‐
72       cations Issue 7, 2018 Edition, Copyright (C) 2018 by the  Institute  of
73       Electrical  and  Electronics Engineers, Inc and The Open Group.  In the
74       event of any discrepancy between this version and the original IEEE and
75       The  Open Group Standard, the original IEEE and The Open Group Standard
76       is the referee document. The original Standard can be  obtained  online
77       at http://www.opengroup.org/unix/online.html .
78
79       Any  typographical  or  formatting  errors that appear in this page are
80       most likely to have been introduced during the conversion of the source
81       files  to  man page format. To report such errors, see https://www.ker
82       nel.org/doc/man-pages/reporting_bugs.html .
83
84
85
86IEEE/The Open Group                  2017                     SIGINTERRUPT(3P)
Impressum