Version 1.0
IRIS WORKSTATION GUIDE 93
Appendix E:
• A set of facilities is outlined below which provide the user with
control over floating point exception handling.
• An exception is triggered in either precision if an attempt is made to
print a not-a-number or infinity.
• The default handling of all floating point exceptions is to abort with
a core dump.
User control over floating point exceptions is provided by the C library
routine
fpsigset()
, and the global exception data structure
_fperror
. This structure
contains a floating point value and information about the circumstances
surrounding the exception. When a floating point exception is triggered, the
following events occur:
• The global structure is filled in with the exception type, the
operation in progress, and the precision of the operation. Unless
the operation is
MATH
, the data value in
_fperror
is set to zero.
• The standard UNIX exception
SIGFPE
is raised. This will abort with
a core dump unless a call has been made to
fpsigset()
(see below), or
the user has otherwise arranged for catching the signal.
• If the
SIGFPE
is caught and the exception is returned from, the data
value found in
_fperror
is returned to the routine which raised the
exception. In the case of floating point compare, this value replaces
the erroneous operand and the comparison is retried. In all other
cases (such as add, subtract, etc.), this value will become the result
of the operation, if one is needed.
User control over floating point exception processing consists of calling
fpsigset()
.
fpsigset()
takes two arguments. The first is a pointer to a user handler function,
or
NULL
if none. The second is a flag word in which individual bits indicate:
• whether an error message should be printed on stderr concerning
the exception.
• whether the process should abort at the end of processing the
exception.
• if the process is to abort, whether or not it should make a core
dump.
The file
/usr/include/fperr.h
contains the definitions for the various bits in this flag
word, as well as the definition for the
_fperror
structure.
fpsigset()
sets a routine to catch the
SIGFPE
signal. When this routine gains
control, it will do the following:
• If a user handler was specified in the last call to
fpsigset()
, it will be
called. The user routine may diagnose the error by examining the
structure
_fperror
and alter the value for the result, if so desired. If
Summary of Contents for IRIS Workstation
Page 1: ...IRIS Workstation Guide Version 1 0 Silicon Graphics Inc Mountain View California 94043 ...
Page 6: ...2 IRIS WORKSTATION GUIDE Version 1 0 Introduction ...
Page 24: ...20 IRIS WORKSTATION GUIDE Version 1 0 Hardware Installation ...
Page 30: ...26 IRIS WORKSTATION GUIDE Version 1 0 Operation ...
Page 48: ...44 IRIS WORKSTATION GUIDE Version 1 0 System Administration ...
Page 50: ...46 IRIS WORKSTATION GUIDE Version 1 0 Appendix A ...
Page 74: ...70 IRIS WORKSTATION GUIDE Version 1 0 Appendix B ...
Page 77: ...Version 1 0 IRIS WORKSTATION GUIDE 73 Appendix C e random gr error f wnrepaint ...
Page 78: ...74 IRIS WORKSTATION GUIDE Version 1 0 Appendix C ...
Page 92: ...88 IRIS WORKSTATION GUIDE Version 1 0 Appendix D ...
Page 102: ...98 IRIS WORKSTATION GUIDE Version 1 0 Appendix E ...
Page 103: ...Appendix F Manual Pages ...
Page 104: ......
Page 131: ...Version 1 0 126 IRIS WORKSTATION GUIDE Appendix F ...
Page 132: ......
Page 136: ...130 IRIS WORKSTATION GUIDE Version 1 0 Appendix H ...
Page 152: ...146 IRIS WORKSTATION GUIDE Version 1 0 Appendix J ...