siginterrupt Subroutine

Purpose

Sets restart behavior with respect to signals and subroutines.

Library

Standard C Library (libc.a)

Syntax

int siginterrupt ( Signal,  Flag)
int Signal, Flag;

Description

The siginterrupt subroutine is used to change the subroutine restart behavior when a subroutine is interrupted by the specified signal. If the flag is false (0), subroutines are restarted if they are interrupted by the specified signal and no data has been transferred yet.

If the flag is true (1), the restarting of subroutines is disabled. If a subroutine is interrupted by the specified signal and no data has been transferred, the subroutine will return a value of -1 with the errno global variable set to EINTR. Interrupted subroutines that have started transferring data return the amount of data actually transferred. Subroutine interrupt is the signal behavior found on 4.1 BSD and AT&T System V UNIX systems.

Note that the BSD signal-handling semantics are not altered in any other way. Most notably, signal handlers always remain installed until explicitly changed by a subsequent sigaction or sigvec call, and the signal mask operates as documented in the sigaction subroutine. Programs can switch between restartable and interruptible subroutine operations as often as desired in the running of a program.

Issuing a siginterrupt call during the running of a signal handler causes the new action to take place on the next signal caught.

Restart does not occur unless it is explicitly specified with the sigaction or sigvec subroutine in the libc.a library.

This subroutine uses an extension of the sigvec subroutine that is not available in the BSD 4.2; hence, it should not be used if backward compatibility is needed.

Parameters

Item Description
Signal Indicates the signal.
Flag Indicates true or false.

Return Values

A value of 0 indicates that the call succeeded. A value of -1 indicates that the supplied signal number is not valid.