1 .\" $NetBSD: siginterrupt.3,v 1.11 2003/08/07 16:42:56 agc Exp $
3 .\" Copyright (c) 1985, 1991, 1993
4 .\" The Regents of the University of California. All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
14 .\" 3. Neither the name of the University nor the names of its contributors
15 .\" may be used to endorse or promote products derived from this software
16 .\" without specific prior written permission.
18 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" @(#)siginterrupt.3 8.1 (Berkeley) 6/4/93
37 .Nd allow signals to interrupt system calls
43 .Fn siginterrupt "int sig" "int flag"
48 is used to change the system call restart
49 behavior when a system call is interrupted by the specified signal.
50 If the flag is false (0), then system calls will be restarted if
51 they are interrupted by the specified signal
52 and no data has been transferred yet.
53 System call restart is the default behavior on
56 If the flag is true (1),
57 then restarting of system calls is disabled.
58 If a system call is interrupted by the specified signal
59 and no data has been transferred,
60 the system call will return \-1 with the global variable
64 Interrupted system calls that have started transferring
65 data will return the amount of data actually transferred.
66 System call interrupt is the signal behavior found on
74 signal handling semantics are not
75 altered in any other way.
76 Most notably, signal handlers always remain installed until
77 explicitly changed by a subsequent
79 call, and the signal mask operates as documented in
81 Programs may switch between restartable and interruptible
82 system call operation as often as desired in the execution of a program.
86 call during the execution of a signal handler will cause
87 the new action to take place on the next signal to be caught.
89 This library routine uses an extension of the
91 system call that is not available in
93 hence it should not be used if backward compatibility is needed.
95 A 0 value indicates that the call succeeded.
96 A \-1 value indicates that an invalid signal number has been supplied.