From within a floating-point signal handler, determines any floating-point exception that caused the trap in the process and changes the state of the Floating-Point Status and Control register (FPSCR) in the user process.
Standard C Library (libc.a)
#include <fpxcp.h> #include <fptrap.h> #include <signal.h>
void fp_sh_info( scp, fcp, struct_size)
struct sigcontext *scp;
struct fp_sh_info *fcp;
size_t struct_size;
void fp_sh_trap_info( scp, fcp)
struct sigcontext *scp;
struct fp_ctx *fcp;
void fp_sh_set_stat( scp, fpscr)
struct sigcontext *scp;
fpstat_t fpscr;
These subroutines are for use within a user-written signal handler. They return information about the process that was running at the time the signal occurred, and they update the Floating-Point Status and Control register for the process.
These subroutines operate only on the state of the user process that was running at the time the signal was delivered. They read and write the sigcontext structure. They do not change the state of the signal handler process itself.
The state of the signal handler process can be modified by the fp_any_enable, fp_is_enabled, fp_enable_all, fp_enable, fp_disable_all, or fp_disable subroutine.
The fp_sh_info subroutine returns information about the process that caused the trap by means of a floating-point context (fp_sh_info) structure. This structure contains the following information:
typedef struct fp_sh_info { fpstat_t fpscr; fpflag_t trap; short trap_mode; char flags; char extra; } fp_sh_info_t;
The fields are:
The fp_sh_trap_info subroutine is maintained for compatibility only. The fp_sh_trap_info subroutine returns information about the process that caused the trap by means of a floating-point context (fp_ctx) structure. This structure contains the following information:
fpstat_t fpscr; fpflag_t trap;
The fields are:
The fp_sh_set_stat subroutine updates the Floating-Point Status and Control register (FPSCR) in the user process with the value in the fpscr field.
The signal handler must either clear the exception bit that caused the trap to occur or disable the trap to prevent a recurrence. If the instruction generated more than one exception, and the signal handler clears only one of these exceptions, a signal is raised for the remaining exception when the next floating-point instruction is executed in the user process.
The fp_any_enable, fp_disable_all, fp_disable, fp_enable_all, fp_enable, or fp_is_enabled (fp_any_enable, fp_is_enabled, fp_enable_all, fp_enable, fp_disable_all, or fp_disable Subroutine) subroutine, fp_clr_flag, fp_read_flag, fp_set_flag, or fp_swap_flag (fp_clr_flag, fp_set_flag, fp_read_flag, or fp_swap_flag Subroutine) subroutine, fp_trap (fp_trap Subroutine) subroutine.
Floating-Point Exceptions in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.