Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

siginterrupt - change behavior of system calls in response to interrupts

&pagelevel(4)&pagelevel

Syntax

#include <signal.h>

int siginterrupt(int sig, int flag);

Description siginterrupt () is used to modify the restart behavior of system calls if the system call

was interrupted by the specified signal. the function has the same effect as the following
implementation:

siginterrupt(int sig, int flag) {
   int ret;
   struct sigaction act;
   (void) sigaction(sig, NULL, &act);
   if (flag)
       act.sa_flags &=~SA_RESTART;
   else
       act.sa_fags |= SA_RESTART;
   ret=sigaction(sig, &act, NULL);
   return ret;
   }

Return val.

0

-1

if successful.

if an error occurs. errno is set to indicate the error..

Errors

siginterrupt() will fail if:

EINVAL      The sig argument specifies an invalid signal number.

Notes

siginterrupt() supports programs which use “historical“ system interfaces. When a new
portable application is written or an existing one rewritten, it should use the sigaction()
function with the SA_RESTART flag instead of siginterrupt().

See also

sigaction(), signal.h.