You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <fenv_libc.h>
int result, new;
/* Get current exception mask to return. */
- fe.fenv = curr.fenv = fegetenv_status ();
+ fe.fenv = curr.fenv = fegetenv_control ();
result = fenv_reg_to_exceptions (fe.l);
if ((excepts & FE_ALL_INVALID) == FE_ALL_INVALID)
fe.l &= ~new;
if (fe.l != curr.l)
- fesetenv_mode (fe.fenv);
+ fesetenv_control (fe.fenv);
- if (new == 0 && result != 0)
- (void)__fe_mask_env ();
+ __TEST_AND_ENTER_NON_STOP (-1ULL, fe.l);
return result;
}