* sysdeps/powerpc/bits/setjmp.h [__WORDSIZE]: Add 64-bit jmpbuf.
authorRoland McGrath <roland@gnu.org>
Fri, 20 Sep 2002 20:06:45 +0000 (20:06 +0000)
committerRoland McGrath <roland@gnu.org>
Fri, 20 Sep 2002 20:06:45 +0000 (20:06 +0000)
* sysdeps/powerpc/bits/wordsize.h: New file.
* sysdeps/powerpc/fpu/bits/mathinline.h (lrint, lrintf): Change long
array to int array for 32-/64-bit compatibility.

2002-09-20  Roland McGrath  <roland@redhat.com>

* login/programs/utmpdump.c: Don't include <error.h>, <errno.h>.

* sysdeps/generic/utimes.c (__utimes): Don't check TVP for null.
Reported by Bruno Haible <bruno@clisp.org>.

* sysdeps/generic/ifreq.h (__ifreq): Compute termination condition
before doubling RQ_LEN.
* sysdeps/unix/sysv/linux/ifreq.h (__ifreq): Likewise.
Reported by Bruno Haible <bruno@clisp.org>.

2002-09-18  Bruno Haible  <bruno@clisp.org>

* login/logout.c (logout): Don't assume ut_time has the same size as
a time_t.
* login/logwtmp.c (logwtmp): Likewise.

* sysdeps/pthread/configure: New file, moved here from
linuxthreads/sysdeps/unix/sysv/linux/configure.

13 files changed:
ChangeLog
linuxthreads/Examples/ex10.c
linuxthreads/internals.h
linuxthreads/pthread.c
localedata/gen-locale.sh
login/programs/utmpdump.c
sysdeps/generic/ifreq.h
sysdeps/generic/utimes.c
sysdeps/powerpc/bits/setjmp.h
sysdeps/powerpc/bits/wordsize.h [new file with mode: 0644]
sysdeps/powerpc/fpu/bits/mathinline.h
sysdeps/pthread/configure [moved from linuxthreads/sysdeps/unix/sysv/linux/configure with 100% similarity]
sysdeps/unix/sysv/linux/ifreq.h

index ff564d6..b6f5082 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,31 @@
+2002-09-20  Steven Munroe  <sjmunroe@us.ibm.com>
+
+       * sysdeps/powerpc/bits/setjmp.h [__WORDSIZE]: Add 64-bit jmpbuf.
+       * sysdeps/powerpc/bits/wordsize.h: New file.
+       * sysdeps/powerpc/fpu/bits/mathinline.h (lrint, lrintf): Change long
+       array to int array for 32-/64-bit compatibility.
+
+2002-09-20  Roland McGrath  <roland@redhat.com>
+
+       * login/programs/utmpdump.c: Don't include <error.h>, <errno.h>.
+
+       * sysdeps/generic/utimes.c (__utimes): Don't check TVP for null.
+       Reported by Bruno Haible <bruno@clisp.org>.
+
+       * sysdeps/generic/ifreq.h (__ifreq): Compute termination condition
+       before doubling RQ_LEN.
+       * sysdeps/unix/sysv/linux/ifreq.h (__ifreq): Likewise.
+       Reported by Bruno Haible <bruno@clisp.org>.
+
+2002-09-18  Bruno Haible  <bruno@clisp.org>
+
+       * login/logout.c (logout): Don't assume ut_time has the same size as
+       a time_t.
+       * login/logwtmp.c (logwtmp): Likewise.
+
+       * sysdeps/pthread/configure: New file, moved here from
+       linuxthreads/sysdeps/unix/sysv/linux/configure.
+
 2002-09-19  Ulrich Drepper  <drepper@redhat.com>
 
        * sysdeps/unix/sysv/linux/_exit.c: Include <errno.h>.
index eee00fa..f3ad517 100644 (file)
@@ -62,6 +62,7 @@ thread (void *arg)
 
       for (;;)
        {
+         int err;
 
          clock_gettime (CLOCK_REALTIME, &ts);
 
@@ -72,7 +73,7 @@ thread (void *arg)
             ts.tv_nsec -= 1000000000L;
          }
 
-         switch (pthread_mutex_timedlock (&mutex, &ts))
+         switch ((err = pthread_mutex_timedlock (&mutex, &ts)))
            {
            case 0:
              flockfile (stdout);
@@ -86,6 +87,8 @@ thread (void *arg)
                      (unsigned long) self);
              funlockfile (stdout);
              continue;
+           default:
+             error (EXIT_FAILURE, err, "pthread_mutex_timedlock failure");
            }
          break;
        }
index 64fb6bb..58a60ff 100644 (file)
@@ -264,7 +264,7 @@ extern void __pthread_destroy_specifics (void);
 extern void __pthread_perform_cleanup (char *currentframe);
 extern void __pthread_init_max_stacksize (void);
 extern int __pthread_initialize_manager (void);
-extern void __pthread_message (char * fmt, ...);
+extern void __pthread_message (const char * fmt, ...);
 extern int __pthread_manager (void *reqfd);
 extern int __pthread_manager_event (void *reqfd);
 extern void __pthread_manager_sighandler (int sig);
index 9713fb5..69f7634 100644 (file)
@@ -1306,7 +1306,7 @@ __pthread_timedsuspend_new(pthread_descr self, const struct timespec *abstime)
 #ifdef DEBUG
 #include <stdarg.h>
 
-void __pthread_message(char * fmt, ...)
+void __pthread_message(const char * fmt, ...)
 {
   char buffer[1024];
   va_list args;
index edd0e89..9e411c1 100644 (file)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Generate test locale files.
-# Copyright (C) 2000-2001 Free Software Foundation, Inc.
+# Copyright (C) 2000,01,02 Free Software Foundation, Inc.
 # This file is part of the GNU C Library.
 #
 
@@ -25,18 +25,22 @@ locfile="$1"; shift
 
 generate_locale ()
 {
-    charmap=$1
-    input=$2
-    out=$3
-    I18NPATH=. GCONV_PATH=${common_objpfx}iconvdata \
-    ${localedef} --quiet -c -f $charmap -i $input \
-      ${common_objpfx}localedata/$out
-
-    if [ $? -ne 0 ]; then
-       echo "Charmap: \"${charmap}\" Inputfile: \"${input}\"" \
-            "Outputdir: \"${out}\" failed"
-       exit 1
-    fi
+  charmap=$1
+  input=$2
+  out=$3
+  if I18NPATH=. GCONV_PATH=${common_objpfx}iconvdata \
+     ${localedef} --quiet -c -f $charmap -i $input \
+                 ${common_objpfx}localedata/$out
+  then
+    # The makefile checks the timestamp of the LC_CTYPE file,
+    # but localedef won't have touched it if it was able to
+    # hard-link it to an existing file.
+    touch ${common_objpfx}localedata/$out/LC_CTYPE
+  else
+    echo "Charmap: \"${charmap}\" Inputfile: \"${input}\"" \
+        "Outputdir: \"${out}\" failed"
+    exit 1
+  fi
 }
 
 locfile=`echo $locfile|sed 's|.*/\([^/]*/LC_CTYPE\)|\1|'`
index 6d19225..d1b5da2 100644 (file)
@@ -18,8 +18,6 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#include <errno.h>
-#include <error.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
index c96d1c8..f750065 100644 (file)
@@ -44,10 +44,10 @@ __ifreq (struct ifreq **ifreqs, int *num_ifs, int sockfd)
     }
 
   ifc.ifc_buf = NULL;
-  rq_len = RQ_IFS * sizeof (struct ifreq);
+  rq_len = RQ_IFS * sizeof (struct ifreq) / 2; /* Doubled in the loop.  */
   do
     {
-      ifc.ifc_len = rq_len;
+      ifc.ifc_len = rq_len *= 2;
       ifc.ifc_buf = realloc (ifc.ifc_buf, ifc.ifc_len);
       if (ifc.ifc_buf == NULL || __ioctl (fd, SIOCGIFCONF, &ifc) < 0)
        {
@@ -60,7 +60,6 @@ __ifreq (struct ifreq **ifreqs, int *num_ifs, int sockfd)
          *ifreqs = NULL;
          return;
        }
-      rq_len *= 2;
     }
   while (rq_len < sizeof (struct ifreq) + ifc.ifc_len);
 
index 67dd16c..e4a6f04 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1995, 1996, 1997, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1991,95,96,97,2000,02 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -27,7 +27,7 @@ __utimes (file, tvp)
      const char *file;
      const struct timeval tvp[2];
 {
-  if (file == NULL || tvp == NULL)
+  if (file == NULL)
     {
       __set_errno (EINVAL);
       return -1;
index b53cdea..3a0a0a0 100644 (file)
 # define JB_GPR1   0  /* Also known as the stack pointer */
 # define JB_GPR2   1
 # define JB_LR     2  /* The address we will return to */
-# define JB_GPRS   3  /* GPRs 14 through 31 are saved, 18 in total */
-# define JB_CR     21 /* Condition code registers. */
-# define JB_FPRS   22 /* FPRs 14 through 31 are saved, 18*2 words total */
-# define JB_SIZE   (58*4)
+# if __WORDSIZE == 64
+#  define JB_GPRS   3  /* GPRs 14 through 31 are saved, 18*2 words total.  */
+#  define JB_CR     21 /* Condition code registers. */
+#  define JB_FPRS   22 /* FPRs 14 through 31 are saved, 18*2 words total.  */
+#  define JB_SIZE   (40*8)
+# else
+#  define JB_GPRS   3  /* GPRs 14 through 31 are saved, 18 in total.  */
+#  define JB_CR     21 /* Condition code registers.  */
+#  define JB_FPRS   22 /* FPRs 14 through 31 are saved, 18*2 words total.  */
+#  define JB_SIZE   (58*4)
+# endif 
 #endif
 
 #ifndef        _ASM
+# if __WORDSIZE == 64
+typedef long int __jmp_buf[40];
+# else
 typedef long int __jmp_buf[58];
+# endif
 #endif
 
 /* Test if longjmp to JMPBUF would unwind the frame
diff --git a/sysdeps/powerpc/bits/wordsize.h b/sysdeps/powerpc/bits/wordsize.h
new file mode 100644 (file)
index 0000000..d856583
--- /dev/null
@@ -0,0 +1,7 @@
+/* Determine the wordsize from the preprocessor defines.  */
+
+#if defined __powerpc64__
+# define __WORDSIZE    64
+#else
+# define __WORDSIZE    32
+#endif
index 2fc9146..34309c1 100644 (file)
@@ -63,8 +63,8 @@ __MATH_INLINE long int
 lrint (double __x) __THROW
 {
   union {
-    double __d;
-    long int __ll[2];
+    double __d;   
+    int __ll[2];
   } __u;
   __asm__ ("fctiw %0,%1" : "=f"(__u.__d) : "f"(__x));
   return __u.__ll[1];
@@ -76,7 +76,7 @@ lrintf (float __x) __THROW
 {
   union {
     double __d;
-    long int __ll[2];
+    int __ll[2];
   } __u;
   __asm__ ("fctiw %0,%1" : "=f"(__u.__d) : "f"(__x));
   return __u.__ll[1];
index 216c1f3..9d42664 100644 (file)
@@ -26,7 +26,7 @@
 #include "kernel-features.h"
 
 /* Variable to signal whether SIOCGIFCONF is not available.  */
-#if __ASSUME_SIOCGIFNAME == 0
+#if __ASSUME_SIOCGIFNAME == 0 || 1
 static int old_siocgifconf;
 #else
 # define old_siocgifconf 0
@@ -73,7 +73,7 @@ __ifreq (struct ifreq **ifreqs, int *num_ifs, int sockfd)
     rq_len = RQ_IFS * sizeof (struct ifreq);
 
   /* Read all the interfaces out of the kernel.  */
-  do
+  while (1)
     {
       ifc.ifc_len = rq_len;
       ifc.ifc_buf = realloc (ifc.ifc_buf, ifc.ifc_len);
@@ -89,9 +89,12 @@ __ifreq (struct ifreq **ifreqs, int *num_ifs, int sockfd)
          *ifreqs = NULL;
          return;
        }
+
+      if (!old_siocgifconf || ifc.ifc_len < rq_len)
+       break;
+
       rq_len *= 2;
     }
-  while (ifc.ifc_len == rq_len && old_siocgifconf);
 
   nifs = ifc.ifc_len / sizeof (struct ifreq);