Back to index

glibc  2.9
feupdateenv.c
Go to the documentation of this file.
00001 /* Install given floating-point environment and raise exceptions
00002    (soft-float edition).
00003    Copyright (C) 2002 Free Software Foundation, Inc.
00004    Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
00005    This file is part of the GNU C Library.
00006 
00007    The GNU C Library is free software; you can redistribute it and/or
00008    modify it under the terms of the GNU Lesser General Public
00009    License as published by the Free Software Foundation; either
00010    version 2.1 of the License, or (at your option) any later version.
00011 
00012    The GNU C Library is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015    Lesser General Public License for more details.
00016 
00017    You should have received a copy of the GNU Lesser General Public
00018    License along with the GNU C Library; if not, write to the Free
00019    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00020    02111-1307 USA.  */
00021 
00022 #include "soft-fp.h"
00023 #include "soft-supp.h"
00024 #include <signal.h>
00025 #include <bp-sym.h>
00026 
00027 int
00028 __feupdateenv (const fenv_t *envp)
00029 {
00030   int saved_exceptions;
00031 
00032   /* Save currently set exceptions.  */
00033   saved_exceptions = __sim_exceptions;
00034 
00035   /* Set environment.  */
00036   fesetenv (envp);
00037 
00038   /* Raise old exceptions.  */
00039   __sim_exceptions |= saved_exceptions;
00040   if (saved_exceptions & ~__sim_disabled_exceptions)
00041     raise (SIGFPE);
00042 
00043   return 0;
00044 }
00045 
00046 #include <shlib-compat.h>
00047 #if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
00048 strong_alias (__feupdateenv, __old_feupdateenv)
00049 compat_symbol (libm, BP_SYM (__old_feupdateenv), BP_SYM (feupdateenv), GLIBC_2_1);
00050 #endif
00051 
00052 versioned_symbol (libm, BP_SYM (__feupdateenv), BP_SYM (feupdateenv), GLIBC_2_2);