about summary refs log tree commit diff
path: root/sysdeps/libm-ieee754
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1997-05-01 01:25:40 +0000
committerUlrich Drepper <drepper@redhat.com>1997-05-01 01:25:40 +0000
commit93256cc1acaefb4c3ae0c13c5b979b298ba66279 (patch)
tree4d7abffa8bb98407bd0da791bea478c85982621e /sysdeps/libm-ieee754
parent779ae82ecdf88b7ed7c1f00d3ed3a639671c3c8d (diff)
downloadglibc-93256cc1acaefb4c3ae0c13c5b979b298ba66279.tar.gz
glibc-93256cc1acaefb4c3ae0c13c5b979b298ba66279.tar.xz
glibc-93256cc1acaefb4c3ae0c13c5b979b298ba66279.zip
1997-05-01 03:13 Ulrich Drepper <drepper@cygnus.com>
	* sysdeps/unix/sysv/linux/shmat.c (shmat): For Linux-2.0 and up the
	kernel can return negative values.  Only fail when return value is
	in range in range which is never returned as valid address.
	Patch by Bruno Haible <haible@ilog.fr>.
Diffstat (limited to 'sysdeps/libm-ieee754')
-rw-r--r--sysdeps/libm-ieee754/s_cexp.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/sysdeps/libm-ieee754/s_cexp.c b/sysdeps/libm-ieee754/s_cexp.c
index 3181af08c7..6ba5b0a4a5 100644
--- a/sysdeps/libm-ieee754/s_cexp.c
+++ b/sysdeps/libm-ieee754/s_cexp.c
@@ -19,6 +19,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #include <complex.h>
+#include <fenv.h>
 #include <math.h>
 
 #include "math_private.h"
@@ -59,6 +60,10 @@ __cexp (__complex__ double x)
 	     is not +-inf the result is NaN + iNaN.  */
 	  __real__ retval = __nan ("");
 	  __imag__ retval = __nan ("");
+
+#ifdef FE_INVALID
+	  feraiseexcept (FE_INVALID);
+#endif
 	}
     }
   else if (rcls == FP_INFINITE)
@@ -89,6 +94,11 @@ __cexp (__complex__ double x)
 	{
 	  __real__ retval = HUGE_VAL;
 	  __imag__ retval = __nan ("");
+
+#ifdef FE_INVALID
+	  if (icls == FP_INFINITE)
+	    feraiseexcept (FE_INVALID);
+#endif
 	}
       else
 	{
@@ -101,6 +111,11 @@ __cexp (__complex__ double x)
       /* If the real part is NaN the result is NaN + iNaN.  */
       __real__ retval = __nan ("");
       __imag__ retval = __nan ("");
+
+#ifdef FE_INVALID
+      if (rcls != FP_NAN || icls != FP_NAN)
+	feraiseexcept (FE_INVALID);
+#endif
     }
 
   return retval;