1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- #include "fenv_libc.h"
- #include <syscall.h>
- #include <sys/prctl.h>
- int
- feholdexcept (fenv_t *envp)
- {
- fenv_union_t u;
- INTERNAL_SYSCALL_DECL (err);
-
- INTERNAL_SYSCALL (prctl, err, 2, PR_GET_FPEXC, &u.l[0]);
- u.l[1] = fegetenv_register ();
- *envp = u.fenv;
-
- u.l[1] &= 3;
-
- fesetenv_register (u.l[1]);
- return 0;
- }
- libm_hidden_def (feholdexcept)
|