xref: /original-bsd/share/man/man3f/traper.3 (revision 29faa970)
Copyright (c) 1983, 1993
The Regents of the University of California. All rights reserved.

%sccs.include.proprietary.roff%

@(#)traper.3 8.1 (Berkeley) 06/05/93

TRAPER 3F ""
C 5
NAME
traper - trap arithmetic errors
SYNOPSIS
integer function traper (mask)
DESCRIPTION
NOTE: This routine applies only to the \s-2VAX\s0. It is ignored on the \s-2PDP11\s0.

Integer overflow and floating point underflow are not normally trapped during execution. This routine enables these traps by setting status bits in the process status word. These bits are reset on entry to a subprogram, and the previous state is restored on return. Therefore, this routine must be called inside each subprogram in which these conditions should be trapped. If the condition occurs and trapping is enabled, signal SIGFPE is sent to the process. (See signal (3C))

The argument has the following meaning:


 value meaning
 0 do not trap either condition
 1 trap integer overflow only
 2 trap floating underflow only
 3 trap both the above

The previous value of these bits is returned.
FILES
"SEE ALSO"
signal(3C), signal(3F)