minix/lib/i386/math/feholdexcept.c

18 lines
294 B
C
Raw Normal View History

2009-12-24 21:22:41 +01:00
#include <errno.h>
#include <fenv.h>
#include "fpu_cw.h"
#include "fpu_sw.h"
int feholdexcept(fenv_t *envp)
{
/* read FPUCW and FPUSW */
envp->cw = fpu_cw_get();
envp->sw = fpu_sw_get();
/* update FPUCW to block exceptions */
fpu_cw_set(envp->cw | FPUCW_EXCEPTION_MASK);
return 0;
}