install C version of _doprnt
[unix-history] / usr / src / lib / libc / gen / siginterrupt.3
CommitLineData
53e9b2ee
KM
1.\" Copyright (c) 1985 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
5.\" @(#)siginterrupt.3 6.1 (Berkeley) %G%
6.\"
7.TH SIGINTERRUPT 3 ""
8.UC 6
9.SH NAME
10siginterrupt \- allow signals to interrupt system calls
11.SH SYNOPSIS
12.nf
13.B siginterrupt(sig, flag);
14.B int sig, flag;
15.SH DESCRIPTION
16.I Siginterrupt
17is used to change the system call restart
18behavior when a system call is interrupted by the specified signal.
19If the flag is false (0), then system calls will be restarted if
20they are interrupted by the specified signal
21and no data has been transferred yet.
22System call restart is the default behavior on 4.2 BSD.
23.PP
24If the flag is true (1), then restarting of system calls is disabled.
25If a system call is interrupted by the specified signal
26and no data has been transferred,
27the system call will return -1 with errno set to EINTR.
28Interrupted system calls that have started transferring
29data will return the amount of data actually transferred.
30System call interrupt is the signal behavior found on 4.1 BSD
31and AT&T System V UNIX systems.
32.PP
33Note that the new 4.2 BSD signal handling semantics are not
34altered in any other way.
35Most notably, signal handlers always remain installed until
36explicitly changed by a subsequent
37.IR sigvec (2)
38call, and the signal mask operates as documented in
39.IR sigvec (2).
40Programs may switch between restartable and interruptible
41system call operation as often as desired in the execution of a program.
42.PP
43Issuing a
44.IR siginterrupt (3)
45call during the execution of a signal handler will cause
46the new action to take place on the next signal to be caught.
47.SH NOTES
48This library routine uses an extension of the
49.IR sigvec (2)
50system call that is not available in 4.2BSD,
51hence it should not be used if backward compatibility is needed.
52.SH "RETURN VALUE
53A 0 value indicates that the call succeeded.
54A -1 value indicates that an invalid signal number has been supplied.
55.SH "SEE ALSO"
56sigvec(2), sigblock(2), sigpause(2), sigsetmask(2).