Back to index

glibc  2.9
Functions
fsetexcptflg.c File Reference
#include <fenv_libc.h>
#include <bp-sym.h>
#include <shlib-compat.h>

Go to the source code of this file.

Functions

int __fesetexceptflag (const fexcept_t *flagp, int excepts)
 versioned_symbol (libm, BP_SYM(__fesetexceptflag), BP_SYM(fesetexceptflag), GLIBC_2_2)

Function Documentation

int __fesetexceptflag ( const fexcept_t flagp,
int  excepts 
)

Definition at line 24 of file fsetexcptflg.c.

{
  fenv_union_t u;
  fexcept_t flag;

  /* Get the current state.  */
  u.fenv = fegetenv_register ();

  /* Ignore exceptions not listed in 'excepts'.  */
  flag = *flagp & excepts;

  /* Replace the exception status */
  u.l[1] = ((u.l[1] & ~(FPSCR_STICKY_BITS & excepts))
           | (flag & FPSCR_STICKY_BITS)
           | (flag >> ((31 - FPSCR_VX) - (31 - FPSCR_VXSOFT))
              & FE_INVALID_SOFTWARE));

  /* Store the new status word (along with the rest of the environment).
     This may cause floating-point exceptions if the restored state
     requests it.  */
  fesetenv_register (u.fenv);

  /* Deal with FE_INVALID_SOFTWARE not being implemented on some chips.  */
  if (flag & FE_INVALID)
    feraiseexcept(FE_INVALID);

  /* Success.  */
  return 0;
}

Here is the call graph for this function:

versioned_symbol ( libm  ,
BP_SYM(__fesetexceptflag ,
BP_SYM(fesetexceptflag ,
GLIBC_2_2   
)