diff options
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/generic/ifreq.h | 5 | ||||
-rw-r--r-- | sysdeps/generic/utimes.c | 4 | ||||
-rw-r--r-- | sysdeps/powerpc/bits/setjmp.h | 19 | ||||
-rw-r--r-- | sysdeps/powerpc/bits/wordsize.h | 7 | ||||
-rw-r--r-- | sysdeps/powerpc/fpu/bits/mathinline.h | 6 | ||||
-rw-r--r-- | sysdeps/pthread/configure | 3 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/ifreq.h | 9 |
7 files changed, 38 insertions, 15 deletions
diff --git a/sysdeps/generic/ifreq.h b/sysdeps/generic/ifreq.h index c96d1c8789..f750065cd3 100644 --- a/sysdeps/generic/ifreq.h +++ b/sysdeps/generic/ifreq.h @@ -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); diff --git a/sysdeps/generic/utimes.c b/sysdeps/generic/utimes.c index 67dd16c51b..e4a6f0427f 100644 --- a/sysdeps/generic/utimes.c +++ b/sysdeps/generic/utimes.c @@ -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; diff --git a/sysdeps/powerpc/bits/setjmp.h b/sysdeps/powerpc/bits/setjmp.h index b53cdea3b2..3a0a0a0d61 100644 --- a/sysdeps/powerpc/bits/setjmp.h +++ b/sysdeps/powerpc/bits/setjmp.h @@ -31,14 +31,25 @@ # 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 index 0000000000..d856583cbf --- /dev/null +++ b/sysdeps/powerpc/bits/wordsize.h @@ -0,0 +1,7 @@ +/* Determine the wordsize from the preprocessor defines. */ + +#if defined __powerpc64__ +# define __WORDSIZE 64 +#else +# define __WORDSIZE 32 +#endif diff --git a/sysdeps/powerpc/fpu/bits/mathinline.h b/sysdeps/powerpc/fpu/bits/mathinline.h index 2fc9146f45..34309c1a68 100644 --- a/sysdeps/powerpc/fpu/bits/mathinline.h +++ b/sysdeps/powerpc/fpu/bits/mathinline.h @@ -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]; diff --git a/sysdeps/pthread/configure b/sysdeps/pthread/configure new file mode 100644 index 0000000000..229414dd74 --- /dev/null +++ b/sysdeps/pthread/configure @@ -0,0 +1,3 @@ +# Local configure fragment for sysdeps/unix/sysv/linux. + +DEFINES="$DEFINES -D_LIBC_REENTRANT" diff --git a/sysdeps/unix/sysv/linux/ifreq.h b/sysdeps/unix/sysv/linux/ifreq.h index 216c1f3373..9d42664444 100644 --- a/sysdeps/unix/sysv/linux/ifreq.h +++ b/sysdeps/unix/sysv/linux/ifreq.h @@ -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); |