Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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>.
  • Loading branch information
Ulrich Drepper committed May 1, 1997
1 parent 779ae82 commit 93256cc
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
7 changes: 7 additions & 0 deletions ChangeLog
@@ -1,3 +1,10 @@
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>.

1997-04-30 17:35 Ulrich Drepper <drepper@cygnus.com>

* math/libm-test.c: Implement test for exceptions.
Expand Down
15 changes: 15 additions & 0 deletions sysdeps/libm-ieee754/s_cexp.c
Expand Up @@ -19,6 +19,7 @@
Boston, MA 02111-1307, USA. */

#include <complex.h>
#include <fenv.h>
#include <math.h>

#include "math_private.h"
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
{
Expand All @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion sysdeps/unix/sysv/linux/shmat.c
Expand Up @@ -33,5 +33,6 @@ shmat (shmid, shmaddr, shmflg)
unsigned long raddr;

retval = __ipc (IPCOP_shmat, shmid, shmflg, (int) &raddr, shmaddr);
return retval < 0 ? (void *) retval : (void *) raddr;
return ((unsigned long int) retval > -(unsigned long int) SHMLBA
? (void *) retval : (void *) raddr);
}

0 comments on commit 93256cc

Please sign in to comment.