about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-08-24 01:36:09 +0000
committerUlrich Drepper <drepper@redhat.com>2002-08-24 01:36:09 +0000
commit27692f89660541896c591236fea9714e72b5a811 (patch)
tree1f537990559c696ec5230fffbfd9a5e0a2288ae1 /sysdeps
parented5294d508443d0db343501d95c917193c4ea1f3 (diff)
downloadglibc-27692f89660541896c591236fea9714e72b5a811.tar.gz
glibc-27692f89660541896c591236fea9714e72b5a811.tar.xz
glibc-27692f89660541896c591236fea9714e72b5a811.zip
Update.
	* sysdeps/ieee754/dbl-64/e_pow.c (log1): Define and initialize
	two52 locally.
	(log2): Likewise.
	* sysdeps/ieee754/dbl-64/upow.h: Remove definition of two52.
	Patch by Simon Gee <simong@agile.tv>.

	* sysdeps/unix/sysv/linux/getsysstats.c (__get_nprocs_conf):
	Prefer reading /proc/stat since it is more uniform across
	architectures.1

	* manual/texinfo.tex: Update to latest official version.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/ieee754/dbl-64/e_pow.c20
-rw-r--r--sysdeps/ieee754/dbl-64/upow.h8
-rw-r--r--sysdeps/unix/sysv/linux/getsysstats.c31
3 files changed, 46 insertions, 13 deletions
diff --git a/sysdeps/ieee754/dbl-64/e_pow.c b/sysdeps/ieee754/dbl-64/e_pow.c
index 000dc94fa0..3b947e4160 100644
--- a/sysdeps/ieee754/dbl-64/e_pow.c
+++ b/sysdeps/ieee754/dbl-64/e_pow.c
@@ -1,7 +1,7 @@
 /*
  * IBM Accurate Mathematical Library
  * written by International Business Machines Corp.
- * Copyright (C) 2001 Free Software Foundation
+ * Copyright (C) 2001, 2002 Free Software Foundation
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -190,6 +190,15 @@ static double log1(double x, double *delta, double *error) {
   double cor;
 #endif
   mynumber u,v;
+#ifdef BIG_ENDI
+  mynumber
+/**/ two52          = {{0x43300000, 0x00000000}}; /* 2**52         */
+#else
+#ifdef LITTLE_ENDI
+  mynumber
+/**/ two52          = {{0x00000000, 0x43300000}}; /* 2**52         */
+#endif
+#endif
 
   u.x = x;
   m = u.i[HIGH_HALF];
@@ -275,6 +284,15 @@ static double log2(double x, double *delta, double *error) {
   double ou1,ou2,lu1,lu2,ov,lv1,lv2,a,a1,a2;
   double y,yy,z,zz,j1,j2,j3,j4,j5,j6,j7,j8;
   mynumber u,v;
+#ifdef BIG_ENDI
+  mynumber
+/**/ two52          = {{0x43300000, 0x00000000}}; /* 2**52         */
+#else
+#ifdef LITTLE_ENDI
+  mynumber
+/**/ two52          = {{0x00000000, 0x43300000}}; /* 2**52         */
+#endif
+#endif
 
   u.x = x;
   m = u.i[HIGH_HALF];
diff --git a/sysdeps/ieee754/dbl-64/upow.h b/sysdeps/ieee754/dbl-64/upow.h
index 76c12939c5..a0b3dcb30e 100644
--- a/sysdeps/ieee754/dbl-64/upow.h
+++ b/sysdeps/ieee754/dbl-64/upow.h
@@ -1,7 +1,7 @@
 /*
  * IBM Accurate Mathematical Library
  * Written by International Business Machines Corp.
- * Copyright (C) 2001 Free Software Foundation, Inc.
+ * Copyright (C) 2001, 2002 Free Software Foundation, Inc.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -44,9 +44,6 @@
 /**/ t52            = {{0x43300000, 0x00000000}}, /* 2**52         */
 /**/ two52e         = {{0x43300000, 0x000003ff}}; /* 2**52'        */
 
- mynumber
-/**/ two52          = {{0x43300000, 0x00000000}}; /* 2**52         */
-
 #else
 #ifdef LITTLE_ENDI
   const static mynumber
@@ -62,9 +59,6 @@
 /**/ t52            = {{0x00000000, 0x43300000}}, /* 2**52         */
 /**/ two52e         = {{0x000003ff, 0x43300000}}; /* 2**52'        */
 
- mynumber
-/**/ two52          = {{0x00000000, 0x43300000}}; /* 2**52         */
-
 #endif
 #endif
 
diff --git a/sysdeps/unix/sysv/linux/getsysstats.c b/sysdeps/unix/sysv/linux/getsysstats.c
index bf39bd9661..f58e2e288a 100644
--- a/sysdeps/unix/sysv/linux/getsysstats.c
+++ b/sysdeps/unix/sysv/linux/getsysstats.c
@@ -1,5 +1,5 @@
 /* Determine various system internal values, Linux version.
-   Copyright (C) 1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc.
+   Copyright (C) 1996-2001, 2002 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
 
@@ -20,6 +20,7 @@
 
 #include <alloca.h>
 #include <assert.h>
+#include <ctype.h>
 #include <errno.h>
 #include <mntent.h>
 #include <paths.h>
@@ -146,17 +147,37 @@ __get_nprocs ()
   /* If we haven't found an appropriate entry return 1.  */
   if (proc_path != NULL)
     {
-      char *proc_cpuinfo = alloca (strlen (proc_path) + sizeof ("/cpuinfo"));
-      __stpcpy (__stpcpy (proc_cpuinfo, proc_path), "/cpuinfo");
+      char *proc_fname = alloca (strlen (proc_path) + sizeof ("/cpuinfo"));
 
-      fp = fopen (proc_cpuinfo, "r");
+      /* The /proc/stat format is more uniform, use it by default.  */
+      __stpcpy (__stpcpy (proc_fname, proc_path), "/stat");
+
+      fp = fopen (proc_fname, "r");
       if (fp != NULL)
 	{
 	  /* No threads use this stream.  */
 	  __fsetlocking (fp, FSETLOCKING_BYCALLER);
-	  GET_NPROCS_PARSER (fp, buffer, result);
+
+	  result = 0;
+	  while (fgets_unlocked (buffer, sizeof (buffer), fp) != NULL)
+	    if (strncmp (buffer, "cpu", 3) == 0 && isdigit (buffer[3]))
+	      ++result;
+
 	  fclose (fp);
 	}
+      else
+	{
+	  __stpcpy (__stpcpy (proc_fname, proc_path), "/cpuinfo");
+
+	  fp = fopen (proc_fname, "r");
+	  if (fp != NULL)
+	    {
+	      /* No threads use this stream.  */
+	      __fsetlocking (fp, FSETLOCKING_BYCALLER);
+	      GET_NPROCS_PARSER (fp, buffer, result);
+	      fclose (fp);
+	    }
+	}
     }
 
   return result;