'\"macro stdmacro
.if n .pH g3.sigintrp @(#)sigintrp	40.6 of 9/18/89
.\" Copyright (c) 1988 Sun Microsystems, Inc. - All Rights Reserved.
.\"
.\" Copyright (c) 1985 Regents of the University of California.
.\" All rights reserved.  The Berkeley software License Agreement
.\" specifies the terms and conditions for redistribution.
.\"
.nr X
.if \nX=0 .ds x} siginterrupt 3 "BSD Compatibility Package" "\&"
.if \nX=1 .ds x} siginterrupt 3 "BSD Compatibility Package"
.if \nX=2 .ds x} siginterrupt 3 "" "\&"
.if \nX=3 .ds x} siginterrupt "" "" "\&"
.TH \*(x}
.SH NAME
\f4siginterrupt\f1 \- allow signals to interrupt system calls
.SH SYNOPSIS
.nf
\f4cc \f1[ \f2flag\f1... ] \f2file\f1 ... \f4\-lucb\f1
.P
\f4int siginterrupt(sig, flag)\f1
\f4int sig, flag;\f1
.fi
.SH DESCRIPTION
\f4siginterrupt\f1
is used to change the system call restart
behavior when a system call is interrupted by the specified signal.
If the flag is false (0), then system calls will be restarted if
they are interrupted by the specified signal
and no data has been transferred yet.
System call restart is the default behavior when the
\f4signal\f1(3) routine is used.
.P
If the flag is true (1), then restarting of system calls is disabled.
If a system call is interrupted by the specified signal
and no data has been transferred,
the system call will return \-1 with
\f4errno\f1
set to
\f4EINTR\fP.
Interrupted system calls that have started transferring
data will return the amount of data actually transferred.
.P
Issuing a
\f4siginterrupt\f1
call during the execution of a signal handler will cause
the new action to take place on the next signal to be caught.
.SH NOTES
This library routine uses an extension of the
\f4sigvec\f1(2)
system call that is not available in 4.2\s-1BSD\s0,
hence it should not be used if backward compatibility is needed.
.SH "RETURN VALUE"
A 0 value indicates that the call succeeded.
A \-1 value indicates that an invalid signal number has been supplied.
.SH "SEE ALSO"
\f4sigblock\fP(3),
\f4sigpause\fP(3),
\f4sigsetmask\fP(3),
\f4sigvec\fP(3),
\f4signal\fP(3).
.P
\f4signal\fP(2)
in the \f2Programmer's Reference Manual\f1.
