This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix ppc64 test-fenv


Hi!

Unless ppc64 glibc is built with --enable-kernel=2.4.21 or higher
(without this switch 2.4.19 is assumed), it will fail test-fenv
no matter whatever kernel it is running on.
The following patch fixes it.

2003-04-11  Jakub Jelinek  <jakub at redhat dot com>

	* sysdeps/unix/sysv/linux/powerpc/powerpc64/fe_nomask.c
	(__fe_nomask_env): Try prctl even if __ASSUME_NEW_PRCTL_SYSCALL
	is not defined, but the prctl constants are.

--- libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/fe_nomask.c.jj	2003-03-06 12:26:24.000000000 -0500
+++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/fe_nomask.c	2003-04-11 10:18:44.000000000 -0400
@@ -27,9 +27,15 @@
 const fenv_t *
 __fe_nomask_env (void)
 {
-#ifdef __ASSUME_NEW_PRCTL_SYSCALL
+#if defined PR_SET_FPEXC && defined PR_FP_EXC_PRECISE
+  int result;
   INTERNAL_SYSCALL_DECL (err);
-  INTERNAL_SYSCALL (prctl, err, 2, PR_SET_FPEXC, PR_FP_EXC_PRECISE);
+  result = INTERNAL_SYSCALL (prctl, err, 2, PR_SET_FPEXC, PR_FP_EXC_PRECISE);
+# ifndef __ASSUME_NEW_PRCTL_SYSCALL
+  if (INTERNAL_SYSCALL_ERROR_P (result, err)
+      && INTERNAL_SYSCALL_ERRNO (result, err) == EINVAL)
+    __set_errno (ENOSYS);
+# endif
 #else  
   __set_errno (ENOSYS);
 #endif

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]