1
0
Files
irix-657m-src/eoe/man/man2/siginterrupt.2
2022-09-29 17:59:04 +03:00

56 lines
1.2 KiB
Groff

'\"! tbl | mmdoc
'\"macro stdmacro
.ie t .ds d \(dg
.el .ds d \z'|+'
.ie t .ds b \(bu
.el .ds b @
.TH siginterrupt 2
.SH NAME
siginterrupt \- allow signals to interrupt functions (X/Open XPG4)
.SH SYNOPSIS
.nf
\f3#include <signal.h>\f1
.sp .8v
\f3int siginterrupt(int sig, int flag);\f1
.fi
.SH DESCRIPTION
.PP
The
.I siginterrupt()
funtion is used to change the restart behaviour when a function is
interrupted by the specified signal.
The function
.I siginterrupt(sig, flag)
has an effect as if implemented as:
.sp .8v
.nf
\f3siginterrupt(int sig, int flag) {
int ret;
struct sigaction act;
void (sigaction)(sig, NULL, \&act);
if (flag)
act.sa_flags \&\= \~SA_RESTART;
else
act.sa_flags \= SA_RESTART;
ret \= sigaction(sig, \&act, NULL);
return ret;
};\fP
.fi
.P
The
.I siginterrupt()
function supports programs written to historical system interfaces.
A portable application, when being written or rewritten, should use
.I sigaction()
with the \f4SA_RESTART\f1 flag instead of
.I siginterrupt().
.SH "SEE ALSO"
sigaction(2).
.SH DIAGNOSTICS
A 0 value indicates that the call succeeded.
A \-1 return value
indicates an error occurred and
.I errno
is set to indicate the reason.