Browse Source

Sync up sparc headers

Eric Andersen 23 years ago
parent
commit
a5cc55111f
67 changed files with 2287 additions and 1264 deletions
  1. 29 14
      libc/sysdeps/linux/sparc/bits/byteswap.h
  2. 16 18
      libc/sysdeps/linux/sparc/bits/cmathcalls.h
  3. 202 44
      libc/sysdeps/linux/sparc/bits/confname.h
  4. 11 20
      libc/sysdeps/linux/sparc/bits/dirent.h
  5. 40 13
      libc/sysdeps/linux/sparc/bits/dlfcn.h
  6. 3 0
      libc/sysdeps/linux/sparc/bits/elfclass.h
  7. 7 2
      libc/sysdeps/linux/sparc/bits/endian.h
  8. 32 16
      libc/sysdeps/linux/sparc/bits/environments.h
  9. 12 18
      libc/sysdeps/linux/sparc/bits/errno.h
  10. 70 18
      libc/sysdeps/linux/sparc/bits/fcntl.h
  11. 11 11
      libc/sysdeps/linux/sparc/bits/fenv.h
  12. 69 34
      libc/sysdeps/linux/sparc/bits/huge_val.h
  13. 27 14
      libc/sysdeps/linux/sparc/bits/in.h
  14. 10 9
      libc/sysdeps/linux/sparc/bits/ioctl-types.h
  15. 8 8
      libc/sysdeps/linux/sparc/bits/ioctls.h
  16. 27 15
      libc/sysdeps/linux/sparc/bits/ipc.h
  17. 144 31
      libc/sysdeps/linux/sparc/bits/libc-lock.h
  18. 25 3
      libc/sysdeps/linux/sparc/bits/local_lim.h
  19. 26 29
      libc/sysdeps/linux/sparc/bits/mathcalls.h
  20. 12 24
      libc/sysdeps/linux/sparc/bits/mathdef.h
  21. 222 6
      libc/sysdeps/linux/sparc/bits/mathinline.h
  22. 27 9
      libc/sysdeps/linux/sparc/bits/mman.h
  23. 34 20
      libc/sysdeps/linux/sparc/bits/msq.h
  24. 8 8
      libc/sysdeps/linux/sparc/bits/nan.h
  25. 9 12
      libc/sysdeps/linux/sparc/bits/poll.h
  26. 11 11
      libc/sysdeps/linux/sparc/bits/posix1_lim.h
  27. 14 23
      libc/sysdeps/linux/sparc/bits/posix2_lim.h
  28. 33 2
      libc/sysdeps/linux/sparc/bits/posix_opt.h
  29. 23 3
      libc/sysdeps/linux/sparc/bits/pthreadtypes.h
  30. 15 11
      libc/sysdeps/linux/sparc/bits/resource.h
  31. 13 13
      libc/sysdeps/linux/sparc/bits/sched.h
  32. 11 18
      libc/sysdeps/linux/sparc/bits/select.h
  33. 19 15
      libc/sysdeps/linux/sparc/bits/sem.h
  34. 38 12
      libc/sysdeps/linux/sparc/bits/setjmp.h
  35. 38 22
      libc/sysdeps/linux/sparc/bits/shm.h
  36. 14 14
      libc/sysdeps/linux/sparc/bits/sigaction.h
  37. 64 15
      libc/sysdeps/linux/sparc/bits/sigcontext.h
  38. 57 21
      libc/sysdeps/linux/sparc/bits/siginfo.h
  39. 9 9
      libc/sysdeps/linux/sparc/bits/signum.h
  40. 8 11
      libc/sysdeps/linux/sparc/bits/sigset.h
  41. 11 11
      libc/sysdeps/linux/sparc/bits/sigstack.h
  42. 6 9
      libc/sysdeps/linux/sparc/bits/sigthread.h
  43. 9 16
      libc/sysdeps/linux/sparc/bits/sockaddr.h
  44. 45 29
      libc/sysdeps/linux/sparc/bits/socket.h
  45. 8 8
      libc/sysdeps/linux/sparc/bits/stab.def
  46. 20 15
      libc/sysdeps/linux/sparc/bits/stat.h
  47. 12 9
      libc/sysdeps/linux/sparc/bits/statfs.h
  48. 35 23
      libc/sysdeps/linux/sparc/bits/statvfs.h
  49. 32 23
      libc/sysdeps/linux/sparc/bits/stdio-lock.h
  50. 21 20
      libc/sysdeps/linux/sparc/bits/stdio.h
  51. 16 12
      libc/sysdeps/linux/sparc/bits/stdio_lim.h
  52. 21 7
      libc/sysdeps/linux/sparc/bits/string.h
  53. 170 143
      libc/sysdeps/linux/sparc/bits/string2.h
  54. 27 19
      libc/sysdeps/linux/sparc/bits/stropts.h
  55. 203 163
      libc/sysdeps/linux/sparc/bits/syscall.h
  56. 9 8
      libc/sysdeps/linux/sparc/bits/termios.h
  57. 30 16
      libc/sysdeps/linux/sparc/bits/time.h
  58. 25 38
      libc/sysdeps/linux/sparc/bits/types.h
  59. 8 8
      libc/sysdeps/linux/sparc/bits/uio.h
  60. 8 8
      libc/sysdeps/linux/sparc/bits/ustat.h
  61. 9 8
      libc/sysdeps/linux/sparc/bits/utmp.h
  62. 14 11
      libc/sysdeps/linux/sparc/bits/utmpx.h
  63. 8 8
      libc/sysdeps/linux/sparc/bits/utsname.h
  64. 9 9
      libc/sysdeps/linux/sparc/bits/waitflags.h
  65. 10 10
      libc/sysdeps/linux/sparc/bits/waitstatus.h
  66. 6 18
      libc/sysdeps/linux/sparc/bits/wordsize.h
  67. 67 19
      libc/sysdeps/linux/sparc/bits/xopen_lim.h

+ 29 - 14
libc/sysdeps/linux/sparc/bits/byteswap.h

@@ -1,21 +1,21 @@
 /* Macros to swap the order of bytes in integer values.
 /* Macros to swap the order of bytes in integer values.
-   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #if !defined _BYTESWAP_H && !defined _NETINET_IN_H
 #if !defined _BYTESWAP_H && !defined _NETINET_IN_H
 # error "Never use <bits/byteswap.h> directly; include <byteswap.h> instead."
 # error "Never use <bits/byteswap.h> directly; include <byteswap.h> instead."
@@ -53,12 +53,27 @@ __bswap_32 (unsigned int __bsx)
 
 
 #if defined __GNUC__ && __GNUC__ >= 2
 #if defined __GNUC__ && __GNUC__ >= 2
 /* Swap bytes in 64 bit value.  */
 /* Swap bytes in 64 bit value.  */
+# define __bswap_constant_64(x) \
+     ((((x) & 0xff00000000000000ull) >> 56)				      \
+      | (((x) & 0x00ff000000000000ull) >> 40)				      \
+      | (((x) & 0x0000ff0000000000ull) >> 24)				      \
+      | (((x) & 0x000000ff00000000ull) >> 8)				      \
+      | (((x) & 0x00000000ff000000ull) << 8)				      \
+      | (((x) & 0x0000000000ff0000ull) << 24)				      \
+      | (((x) & 0x000000000000ff00ull) << 40)				      \
+      | (((x) & 0x00000000000000ffull) << 56))
+
 # define __bswap_64(x) \
 # define __bswap_64(x) \
      (__extension__							      \
      (__extension__							      \
-      ({ union { unsigned long long int __ll;				      \
+      ({ union { __extension__ unsigned long long int __ll;		      \
-		 unsigned long int __l[2]; } __v, __r;			      \
+		 unsigned int __l[2]; } __w, __r;			      \
-	 __v.__ll = (x);						      \
+         if (__builtin_constant_p (x))					      \
-	 __r.__l[0] = __bswap_32 (__v.__l[1]);				      \
+	   __r.__ll = __bswap_constant_64 (x);				      \
-	 __r.__l[1] = __bswap_32 (__v.__l[0]);				      \
+	 else								      \
+	   {								      \
+	     __w.__ll = (x);						      \
+	     __r.__l[0] = __bswap_32 (__w.__l[1]);			      \
+	     __r.__l[1] = __bswap_32 (__w.__l[0]);			      \
+	   }								      \
 	 __r.__ll; }))
 	 __r.__ll; }))
 #endif
 #endif

+ 16 - 18
libc/sysdeps/linux/sparc/bits/cmathcalls.h

@@ -1,22 +1,22 @@
 /* Prototype declarations for complex math functions;
 /* Prototype declarations for complex math functions;
    helper file for <complex.h>.
    helper file for <complex.h>.
-   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998, 2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 /* NOTE: Because of the special way this file is used by <complex.h>, this
 /* NOTE: Because of the special way this file is used by <complex.h>, this
    file must NOT be protected from multiple inclusion as header files
    file must NOT be protected from multiple inclusion as header files
@@ -47,7 +47,6 @@
 
 
 #define _Mdouble_complex_ _Mdouble_ _Complex
 #define _Mdouble_complex_ _Mdouble_ _Complex
 
 
-__BEGIN_DECLS
 
 
 /* Trigonometric functions.  */
 /* Trigonometric functions.  */
 
 
@@ -131,30 +130,29 @@ __MATHDECL (_Mdouble_,creal, (_Mdouble_complex_ __z));
 
 
 
 
 /* Now some optimized versions.  GCC has handy notations for these
 /* Now some optimized versions.  GCC has handy notations for these
-   functions.  */
+   functions.  Recent GCC handles these as builtin functions so does
-#if defined __GNUC__ && defined __OPTIMIZE__
+   not need inlines.  */
+#if defined __GNUC__ && !__GNUC_PREREQ (2, 97) && defined __OPTIMIZE__
 
 
 /* Imaginary part of Z.  */
 /* Imaginary part of Z.  */
 extern __inline _Mdouble_
 extern __inline _Mdouble_
-__MATH_PRECNAME(cimag) (_Mdouble_complex_ __z)
+__MATH_PRECNAME(cimag) (_Mdouble_complex_ __z) __THROW
 {
 {
   return __imag__ __z;
   return __imag__ __z;
 }
 }
 
 
 /* Real part of Z.  */
 /* Real part of Z.  */
 extern __inline _Mdouble_
 extern __inline _Mdouble_
-__MATH_PRECNAME(creal) (_Mdouble_complex_ __z)
+__MATH_PRECNAME(creal) (_Mdouble_complex_ __z) __THROW
 {
 {
   return __real__ __z;
   return __real__ __z;
 }
 }
 
 
 /* Complex conjugate of Z.  */
 /* Complex conjugate of Z.  */
 extern __inline _Mdouble_complex_
 extern __inline _Mdouble_complex_
-__MATH_PRECNAME(conj) (_Mdouble_complex_ __z)
+__MATH_PRECNAME(conj) (_Mdouble_complex_ __z) __THROW
 {
 {
-  return ~__z;
+  return __extension__ ~__z;
 }
 }
 
 
 #endif
 #endif
-
-__END_DECLS

+ 202 - 44
libc/sysdeps/linux/sparc/bits/confname.h

@@ -1,21 +1,21 @@
 /* `sysconf', `pathconf', and `confstr' NAME values.  Generic version.
 /* `sysconf', `pathconf', and `confstr' NAME values.  Generic version.
-   Copyright (C) 1993, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1993, 1995-1998, 2000, 2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #ifndef _UNISTD_H
 #ifndef _UNISTD_H
 # error "Never use <bits/confname.h> directly; include <unistd.h> instead."
 # error "Never use <bits/confname.h> directly; include <unistd.h> instead."
@@ -50,8 +50,20 @@ enum
 #define	_PC_PRIO_IO			_PC_PRIO_IO
 #define	_PC_PRIO_IO			_PC_PRIO_IO
     _PC_SOCK_MAXBUF,
     _PC_SOCK_MAXBUF,
 #define	_PC_SOCK_MAXBUF			_PC_SOCK_MAXBUF
 #define	_PC_SOCK_MAXBUF			_PC_SOCK_MAXBUF
-    _PC_FILESIZEBITS
+    _PC_FILESIZEBITS,
 #define _PC_FILESIZEBITS		_PC_FILESIZEBITS
 #define _PC_FILESIZEBITS		_PC_FILESIZEBITS
+    _PC_REC_INCR_XFER_SIZE,
+#define _PC_REC_INCR_XFER_SIZE		_PC_REC_INCR_XFER_SIZE
+    _PC_REC_MAX_XFER_SIZE,
+#define _PC_REC_MAX_XFER_SIZE		_PC_REC_MAX_XFER_SIZE
+    _PC_REC_MIN_XFER_SIZE,
+#define _PC_REC_MIN_XFER_SIZE		_PC_REC_MIN_XFER_SIZE
+    _PC_REC_XFER_ALIGN,
+#define _PC_REC_XFER_ALIGN		_PC_REC_XFER_ALIGN
+    _PC_ALLOC_SIZE_MIN,
+#define _PC_ALLOC_SIZE_MIN		_PC_ALLOC_SIZE_MIN
+    _PC_SYMLINK_MAX
+#define _PC_SYMLINK_MAX			_PC_SYMLINK_MAX
   };
   };
 
 
 /* Values for the argument to `sysconf'.  */
 /* Values for the argument to `sysconf'.  */
@@ -185,6 +197,8 @@ enum
 #define	_SC_SELECT			_SC_SELECT
 #define	_SC_SELECT			_SC_SELECT
     _SC_UIO_MAXIOV,
     _SC_UIO_MAXIOV,
 #define	_SC_UIO_MAXIOV			_SC_UIO_MAXIOV
 #define	_SC_UIO_MAXIOV			_SC_UIO_MAXIOV
+    _SC_IOV_MAX = _SC_UIO_MAXIOV,
+#define _SC_IOV_MAX			_SC_IOV_MAX
     _SC_PII_INTERNET_STREAM,
     _SC_PII_INTERNET_STREAM,
 #define	_SC_PII_INTERNET_STREAM		_SC_PII_INTERNET_STREAM
 #define	_SC_PII_INTERNET_STREAM		_SC_PII_INTERNET_STREAM
     _SC_PII_INTERNET_DGRAM,
     _SC_PII_INTERNET_DGRAM,
@@ -335,8 +349,117 @@ enum
 #define _SC_XOPEN_LEGACY		_SC_XOPEN_LEGACY
 #define _SC_XOPEN_LEGACY		_SC_XOPEN_LEGACY
     _SC_XOPEN_REALTIME,
     _SC_XOPEN_REALTIME,
 #define _SC_XOPEN_REALTIME		_SC_XOPEN_REALTIME
 #define _SC_XOPEN_REALTIME		_SC_XOPEN_REALTIME
-    _SC_XOPEN_REALTIME_THREADS
+    _SC_XOPEN_REALTIME_THREADS,
 #define _SC_XOPEN_REALTIME_THREADS	_SC_XOPEN_REALTIME_THREADS
 #define _SC_XOPEN_REALTIME_THREADS	_SC_XOPEN_REALTIME_THREADS
+
+    _SC_ADVISORY_INFO,
+#define _SC_ADVISORY_INFO		_SC_ADVISORY_INFO
+    _SC_BARRIERS,
+#define _SC_BARRIERS			_SC_BARRIERS
+    _SC_BASE,
+#define _SC_BASE			_SC_BASE
+    _SC_C_LANG_SUPPORT,
+#define _SC_C_LANG_SUPPORT		_SC_C_LANG_SUPPORT
+    _SC_C_LANG_SUPPORT_R,
+#define _SC_C_LANG_SUPPORT_R		_SC_C_LANG_SUPPORT_R
+    _SC_CLOCK_SELECTION,
+#define _SC_CLOCK_SELECTION		_SC_CLOCK_SELECTION
+    _SC_CPUTIME,
+#define _SC_CPUTIME			_SC_CPUTIME
+    _SC_THREAD_CPUTIME,
+#define _SC_THREAD_CPUTIME		_SC_THREAD_CPUTIME
+    _SC_DEVICE_IO,
+#define _SC_DEVICE_IO			_SC_DEVICE_IO
+    _SC_DEVICE_SPECIFIC,
+#define _SC_DEVICE_SPECIFIC		_SC_DEVICE_SPECIFIC
+    _SC_DEVICE_SPECIFIC_R,
+#define _SC_DEVICE_SPECIFIC_R		_SC_DEVICE_SPECIFIC_R
+    _SC_FD_MGMT,
+#define _SC_FD_MGMT			_SC_FD_MGMT
+    _SC_FIFO,
+#define _SC_FIFO			_SC_FIFO
+    _SC_PIPE,
+#define _SC_PIPE			_SC_PIPE
+    _SC_FILE_ATTRIBUTES,
+#define _SC_FILE_ATTRIBUTES		_SC_FILE_ATTRIBUTES
+    _SC_FILE_LOCKING,
+#define _SC_FILE_LOCKING		_SC_FILE_LOCKING
+    _SC_FILE_SYSTEM,
+#define _SC_FILE_SYSTEM			_SC_FILE_SYSTEM
+    _SC_MONOTONIC_CLOCK,
+#define _SC_MONOTONIC_CLOCK		_SC_MONOTONIC_CLOCK
+    _SC_MULTI_PROCESS,
+#define _SC_MULTI_PROCESS		_SC_MULTI_PROCESS
+    _SC_SINGLE_PROCESS,
+#define _SC_SINGLE_PROCESS		_SC_SINGLE_PROCESS
+    _SC_NETWORKING,
+#define _SC_NETWORKING			_SC_NETWORKING
+    _SC_READER_WRITER_LOCKS,
+#define _SC_READER_WRITER_LOCKS		_SC_READER_WRITER_LOCKS
+    _SC_SPIN_LOCKS,
+#define _SC_SPIN_LOCKS			_SC_SPIN_LOCKS
+    _SC_REGEXP,
+#define _SC_REGEXP			_SC_REGEXP
+    _SC_REGEX_VERSION,
+#define _SC_REGEX_VERSION		_SC_REGEX_VERSION
+    _SC_SHELL,
+#define _SC_SHELL			_SC_SHELL
+    _SC_SIGNALS,
+#define _SC_SIGNALS			_SC_SIGNALS
+    _SC_SPAWN,
+#define _SC_SPAWN			_SC_SPAWN
+    _SC_SPORADIC_SERVER,
+#define _SC_SPORADIC_SERVER		_SC_SPORADIC_SERVER
+    _SC_THREAD_SPORADIC_SERVER,
+#define _SC_THREAD_SPORADIC_SERVER	_SC_THREAD_SPORADIC_SERVER
+    _SC_SYSTEM_DATABASE,
+#define _SC_SYSTEM_DATABASE		_SC_SYSTEM_DATABASE
+    _SC_SYSTEM_DATABASE_R,
+#define _SC_SYSTEM_DATABASE_R		_SC_SYSTEM_DATABASE_R
+    _SC_TIMEOUTS,
+#define _SC_TIMEOUTS			_SC_TIMEOUTS
+    _SC_TYPED_MEMORY_OBJECTS,
+#define _SC_TYPED_MEMORY_OBJECTS	_SC_TYPED_MEMORY_OBJECTS
+    _SC_USER_GROUPS,
+#define _SC_USER_GROUPS			_SC_USER_GROUPS
+    _SC_USER_GROUPS_R,
+#define _SC_USER_GROUPS_R		_SC_USER_GROUPS_R
+    _SC_2_PBS,
+#define _SC_2_PBS			_SC_2_PBS
+    _SC_2_PBS_ACCOUNTING,
+#define _SC_2_PBS_ACCOUNTING		_SC_2_PBS_ACCOUNTING
+    _SC_2_PBS_LOCATE,
+#define _SC_2_PBS_LOCATE		_SC_2_PBS_LOCATE
+    _SC_2_PBS_MESSAGE,
+#define _SC_2_PBS_MESSAGE		_SC_2_PBS_MESSAGE
+    _SC_2_PBS_TRACK,
+#define _SC_2_PBS_TRACK			_SC_2_PBS_TRACK
+    _SC_SYMLOOP_MAX,
+#define _SC_SYMLOOP_MAX			_SC_SYMLOOP_MAX
+    _SC_STREAMS,
+#define _SC_STREAMS			_SC_STREAMS
+    _SC_2_PBS_CHECKPOINT,
+#define _SC_2_PBS_CHECKPOINT		_SC_2_PBS_CHECKPOINT
+
+    _SC_V6_ILP32_OFF32,
+#define _SC_V6_ILP32_OFF32		_SC_V6_ILP32_OFF32
+    _SC_V6_ILP32_OFFBIG,
+#define _SC_V6_ILP32_OFFBIG		_SC_V6_ILP32_OFFBIG
+    _SC_V6_LP64_OFF64,
+#define _SC_V6_LP64_OFF64		_SC_V6_LP64_OFF64
+    _SC_V6_LPBIG_OFFBIG,
+#define _SC_V6_LPBIG_OFFBIG		_SC_V6_LPBIG_OFFBIG
+
+    _SC_HOST_NAME_MAX,
+#define _SC_HOST_NAME_MAX		_SC_HOST_NAME_MAX
+    _SC_TRACE,
+#define _SC_TRACE			_SC_TRACE
+    _SC_TRACE_EVENT_FILTER,
+#define _SC_TRACE_EVENT_FILTER		_SC_TRACE_EVENT_FILTER
+    _SC_TRACE_INHERIT,
+#define _SC_TRACE_INHERIT		_SC_TRACE_INHERIT
+    _SC_TRACE_LOG
+#define _SC_TRACE_LOG			_SC_TRACE_LOG
   };
   };
 
 
 #if (defined __USE_POSIX2 || defined __USE_UNIX98 \
 #if (defined __USE_POSIX2 || defined __USE_UNIX98 \
@@ -345,64 +468,99 @@ enum
 /* Values for the NAME argument to `confstr'.  */
 /* Values for the NAME argument to `confstr'.  */
 enum
 enum
   {
   {
-    _CS_PATH			/* The default search path.  */
+    _CS_PATH,			/* The default search path.  */
 #define _CS_PATH		_CS_PATH
 #define _CS_PATH		_CS_PATH
 
 
-#if (defined __USE_FILE_OFFSET64 || defined __USE_LARGEFILE64 \
+# if (defined __USE_FILE_OFFSET64 || defined __USE_LARGEFILE64 \
      || defined __USE_LARGEFILE)
      || defined __USE_LARGEFILE)
-    ,
     _CS_LFS_CFLAGS = 1000,
     _CS_LFS_CFLAGS = 1000,
-# define _CS_LFS_CFLAGS		_CS_LFS_CFLAGS
+#  define _CS_LFS_CFLAGS		_CS_LFS_CFLAGS
     _CS_LFS_LDFLAGS,
     _CS_LFS_LDFLAGS,
-# define _CS_LFS_LDFLAGS	_CS_LFS_LDFLAGS
+#  define _CS_LFS_LDFLAGS	_CS_LFS_LDFLAGS
     _CS_LFS_LIBS,
     _CS_LFS_LIBS,
-# define _CS_LFS_LIBS		_CS_LFS_LIBS
+#  define _CS_LFS_LIBS		_CS_LFS_LIBS
     _CS_LFS_LINTFLAGS,
     _CS_LFS_LINTFLAGS,
-# define _CS_LFS_LINTFLAGS	_CS_LFS_LINTFLAGS
+#  define _CS_LFS_LINTFLAGS	_CS_LFS_LINTFLAGS
     _CS_LFS64_CFLAGS,
     _CS_LFS64_CFLAGS,
-# define _CS_LFS64_CFLAGS	_CS_LFS64_CFLAGS
+#  define _CS_LFS64_CFLAGS	_CS_LFS64_CFLAGS
     _CS_LFS64_LDFLAGS,
     _CS_LFS64_LDFLAGS,
-# define _CS_LFS64_LDFLAGS	_CS_LFS64_LDFLAGS
+#  define _CS_LFS64_LDFLAGS	_CS_LFS64_LDFLAGS
     _CS_LFS64_LIBS,
     _CS_LFS64_LIBS,
-# define _CS_LFS64_LIBS		_CS_LFS64_LIBS
+#  define _CS_LFS64_LIBS		_CS_LFS64_LIBS
-    _CS_LFS64_LINTFLAGS
+    _CS_LFS64_LINTFLAGS,
-# define _CS_LFS64_LINTFLAGS	_CS_LFS64_LINTFLAGS
+#  define _CS_LFS64_LINTFLAGS	_CS_LFS64_LINTFLAGS
-#endif
+# endif
 
 
-#ifdef __USE_UNIX98
+# ifdef __USE_UNIX98
-    ,
     _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,
     _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,
-# define _CS_XBS5_ILP32_OFF32_CFLAGS _CS_XBS5_ILP32_OFF32_CFLAGS
+#  define _CS_XBS5_ILP32_OFF32_CFLAGS _CS_XBS5_ILP32_OFF32_CFLAGS
     _CS_XBS5_ILP32_OFF32_LDFLAGS,
     _CS_XBS5_ILP32_OFF32_LDFLAGS,
-# define _CS_XBS5_ILP32_OFF32_LDFLAGS _CS_XBS5_ILP32_OFF32_LDFLAGS
+#  define _CS_XBS5_ILP32_OFF32_LDFLAGS _CS_XBS5_ILP32_OFF32_LDFLAGS
     _CS_XBS5_ILP32_OFF32_LIBS,
     _CS_XBS5_ILP32_OFF32_LIBS,
-# define _CS_XBS5_ILP32_OFF32_LIBS _CS_XBS5_ILP32_OFF32_LIBS
+#  define _CS_XBS5_ILP32_OFF32_LIBS _CS_XBS5_ILP32_OFF32_LIBS
     _CS_XBS5_ILP32_OFF32_LINTFLAGS,
     _CS_XBS5_ILP32_OFF32_LINTFLAGS,
-# define _CS_XBS5_ILP32_OFF32_LINTFLAGS _CS_XBS5_ILP32_OFF32_LINTFLAGS
+#  define _CS_XBS5_ILP32_OFF32_LINTFLAGS _CS_XBS5_ILP32_OFF32_LINTFLAGS
     _CS_XBS5_ILP32_OFFBIG_CFLAGS,
     _CS_XBS5_ILP32_OFFBIG_CFLAGS,
-# define _CS_XBS5_ILP32_OFFBIG_CFLAGS _CS_XBS5_ILP32_OFFBIG_CFLAGS
+#  define _CS_XBS5_ILP32_OFFBIG_CFLAGS _CS_XBS5_ILP32_OFFBIG_CFLAGS
     _CS_XBS5_ILP32_OFFBIG_LDFLAGS,
     _CS_XBS5_ILP32_OFFBIG_LDFLAGS,
-# define _CS_XBS5_ILP32_OFFBIG_LDFLAGS _CS_XBS5_ILP32_OFFBIG_LDFLAGS
+#  define _CS_XBS5_ILP32_OFFBIG_LDFLAGS _CS_XBS5_ILP32_OFFBIG_LDFLAGS
     _CS_XBS5_ILP32_OFFBIG_LIBS,
     _CS_XBS5_ILP32_OFFBIG_LIBS,
-# define _CS_XBS5_ILP32_OFFBIG_LIBS _CS_XBS5_ILP32_OFFBIG_LIBS
+#  define _CS_XBS5_ILP32_OFFBIG_LIBS _CS_XBS5_ILP32_OFFBIG_LIBS
     _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,
     _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,
-# define _CS_XBS5_ILP32_OFFBIG_LINTFLAGS _CS_XBS5_ILP32_OFFBIG_LINTFLAGS
+#  define _CS_XBS5_ILP32_OFFBIG_LINTFLAGS _CS_XBS5_ILP32_OFFBIG_LINTFLAGS
     _CS_XBS5_LP64_OFF64_CFLAGS,
     _CS_XBS5_LP64_OFF64_CFLAGS,
-# define _CS_XBS5_LP64_OFF64_CFLAGS _CS_XBS5_LP64_OFF64_CFLAGS
+#  define _CS_XBS5_LP64_OFF64_CFLAGS _CS_XBS5_LP64_OFF64_CFLAGS
     _CS_XBS5_LP64_OFF64_LDFLAGS,
     _CS_XBS5_LP64_OFF64_LDFLAGS,
-# define _CS_XBS5_LP64_OFF64_LDFLAGS _CS_XBS5_LP64_OFF64_LDFLAGS
+#  define _CS_XBS5_LP64_OFF64_LDFLAGS _CS_XBS5_LP64_OFF64_LDFLAGS
     _CS_XBS5_LP64_OFF64_LIBS,
     _CS_XBS5_LP64_OFF64_LIBS,
-# define _CS_XBS5_LP64_OFF64_LIBS _CS_XBS5_LP64_OFF64_LIBS
+#  define _CS_XBS5_LP64_OFF64_LIBS _CS_XBS5_LP64_OFF64_LIBS
     _CS_XBS5_LP64_OFF64_LINTFLAGS,
     _CS_XBS5_LP64_OFF64_LINTFLAGS,
-# define _CS_XBS5_LP64_OFF64_LINTFLAGS _CS_XBS5_LP64_OFF64_LINTFLAGS
+#  define _CS_XBS5_LP64_OFF64_LINTFLAGS _CS_XBS5_LP64_OFF64_LINTFLAGS
     _CS_XBS5_LPBIG_OFFBIG_CFLAGS,
     _CS_XBS5_LPBIG_OFFBIG_CFLAGS,
-# define _CS_XBS5_LPBIG_OFFBIG_CFLAGS _CS_XBS5_LPBIG_OFFBIG_CFLAGS
+#  define _CS_XBS5_LPBIG_OFFBIG_CFLAGS _CS_XBS5_LPBIG_OFFBIG_CFLAGS
     _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,
     _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,
-# define _CS_XBS5_LPBIG_OFFBIG_LDFLAGS _CS_XBS5_LPBIG_OFFBIG_LDFLAGS
+#  define _CS_XBS5_LPBIG_OFFBIG_LDFLAGS _CS_XBS5_LPBIG_OFFBIG_LDFLAGS
     _CS_XBS5_LPBIG_OFFBIG_LIBS,
     _CS_XBS5_LPBIG_OFFBIG_LIBS,
-# define _CS_XBS5_LPBIG_OFFBIG_LIBS _CS_XBS5_LPBIG_OFFBIG_LIBS
+#  define _CS_XBS5_LPBIG_OFFBIG_LIBS _CS_XBS5_LPBIG_OFFBIG_LIBS
-    _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS
+    _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,
-# define _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS
+#  define _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS
-#endif
+# endif
+# ifdef __USE_XOPEN2K
+    _CS_POSIX_V6_ILP32_OFF32_CFLAGS,
+#  define _CS_POSIX_V6_ILP32_OFF32_CFLAGS _CS_POSIX_V6_ILP32_OFF32_CFLAGS
+    _CS_POSIX_V6_ILP32_OFF32_LDFLAGS,
+#  define _CS_POSIX_V6_ILP32_OFF32_LDFLAGS _CS_POSIX_V6_ILP32_OFF32_LDFLAGS
+    _CS_POSIX_V6_ILP32_OFF32_LIBS,
+#  define _CS_POSIX_V6_ILP32_OFF32_LIBS _CS_POSIX_V6_ILP32_OFF32_LIBS
+    _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,
+#  define _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS
+    _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,
+#  define _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS
+    _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,
+#  define _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS
+    _CS_POSIX_V6_ILP32_OFFBIG_LIBS,
+#  define _CS_POSIX_V6_ILP32_OFFBIG_LIBS _CS_POSIX_V6_ILP32_OFFBIG_LIBS
+    _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,
+#  define _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS
+    _CS_POSIX_V6_LP64_OFF64_CFLAGS,
+#  define _CS_POSIX_V6_LP64_OFF64_CFLAGS _CS_POSIX_V6_LP64_OFF64_CFLAGS
+    _CS_POSIX_V6_LP64_OFF64_LDFLAGS,
+#  define _CS_POSIX_V6_LP64_OFF64_LDFLAGS _CS_POSIX_V6_LP64_OFF64_LDFLAGS
+    _CS_POSIX_V6_LP64_OFF64_LIBS,
+#  define _CS_POSIX_V6_LP64_OFF64_LIBS _CS_POSIX_V6_LP64_OFF64_LIBS
+    _CS_POSIX_V6_LP64_OFF64_LINTFLAGS,
+#  define _CS_POSIX_V6_LP64_OFF64_LINTFLAGS _CS_POSIX_V6_LP64_OFF64_LINTFLAGS
+    _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,
+#  define _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS
+    _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,
+#  define _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS
+    _CS_POSIX_V6_LPBIG_OFFBIG_LIBS,
+#  define _CS_POSIX_V6_LPBIG_OFFBIG_LIBS _CS_POSIX_V6_LPBIG_OFFBIG_LIBS
+    _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS,
+#  define _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS
+# endif
+
+    _CS_V6_WIDTH_RESTRICTED_ENVS
+# define _CS_V6_WIDTH_RESTRICTED_ENVS	_CS_V6_WIDTH_RESTRICTED_ENVS
   };
   };
 #endif
 #endif

+ 11 - 20
libc/sysdeps/linux/sparc/bits/dirent.h

@@ -2,29 +2,19 @@
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
-
-/*
- * June 25, 2001
- *
- * Removed d_type support for dirent and undefined _DIRENT_HAVE_D_TYPE;
- * i.e. match the kernel structs and avoid any translation for now.
- * Note: glibc fakes d_type for the dirent case.
- * Note: dirent64 still has the d_type field.
- */
 
 
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 
 #ifndef _DIRENT_H
 #ifndef _DIRENT_H
 # error "Never use <bits/dirent.h> directly; include <dirent.h> instead."
 # error "Never use <bits/dirent.h> directly; include <dirent.h> instead."
@@ -40,6 +30,7 @@ struct dirent
     __off64_t d_off;
     __off64_t d_off;
 #endif
 #endif
     unsigned short int d_reclen;
     unsigned short int d_reclen;
+    /*unsigned char d_type;*/
     char d_name[256];		/* We must not include limits.h! */
     char d_name[256];		/* We must not include limits.h! */
   };
   };
 
 
@@ -49,7 +40,7 @@ struct dirent64
     __ino64_t d_ino;
     __ino64_t d_ino;
     __off64_t d_off;
     __off64_t d_off;
     unsigned short int d_reclen;
     unsigned short int d_reclen;
-    unsigned char d_type;
+    /*unsigned char d_type;*/
     char d_name[256];		/* We must not include limits.h! */
     char d_name[256];		/* We must not include limits.h! */
   };
   };
 #endif
 #endif
@@ -59,4 +50,4 @@ struct dirent64
 #undef  _DIRENT_HAVE_D_NAMLEN
 #undef  _DIRENT_HAVE_D_NAMLEN
 #define _DIRENT_HAVE_D_RECLEN
 #define _DIRENT_HAVE_D_RECLEN
 #define _DIRENT_HAVE_D_OFF
 #define _DIRENT_HAVE_D_OFF
-#undef  _DIRENT_HAVE_D_TYPE
+#undef _DIRENT_HAVE_D_TYPE

+ 40 - 13
libc/sysdeps/linux/sparc/bits/dlfcn.h

@@ -1,37 +1,64 @@
 /* System dependent definitions for run-time dynamic loading.
 /* System dependent definitions for run-time dynamic loading.
-   Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #ifndef _DLFCN_H
 #ifndef _DLFCN_H
 # error "Never use <bits/dlfcn.h> directly; include <dlfcn.h> instead."
 # error "Never use <bits/dlfcn.h> directly; include <dlfcn.h> instead."
 #endif
 #endif
 
 
 /* The MODE argument to `dlopen' contains one of the following: */
 /* The MODE argument to `dlopen' contains one of the following: */
-#define RTLD_LAZY	0x001	/* Lazy function call binding.  */
+#define RTLD_LAZY	0x00001	/* Lazy function call binding.  */
-#define RTLD_NOW	0x002	/* Immediate function call binding.  */
+#define RTLD_NOW	0x00002	/* Immediate function call binding.  */
-#define	RTLD_BINDING_MASK 0x3	/* Mask of binding time value.  */
+#define	RTLD_BINDING_MASK   0x3	/* Mask of binding time value.  */
+#define RTLD_NOLOAD	0x00004	/* Do not load the object.  */
 
 
 /* If the following bit is set in the MODE argument to `dlopen',
 /* If the following bit is set in the MODE argument to `dlopen',
    the symbols of the loaded object and its dependencies are made
    the symbols of the loaded object and its dependencies are made
    visible as if the object were linked directly into the program.  */
    visible as if the object were linked directly into the program.  */
-#define RTLD_GLOBAL	0x100
+#define RTLD_GLOBAL	0x00100
 
 
 /* Unix98 demands the following flag which is the inverse to RTLD_GLOBAL.
 /* Unix98 demands the following flag which is the inverse to RTLD_GLOBAL.
    The implementation does this by default and so we can define the
    The implementation does this by default and so we can define the
    value to zero.  */
    value to zero.  */
 #define RTLD_LOCAL	0
 #define RTLD_LOCAL	0
+
+/* Do not delete object when closed.  */
+#define RTLD_NODELETE	0x01000
+
+#ifdef __USE_GNU
+/* To support profiling of shared objects it is a good idea to call
+   the function found using `dlsym' using the following macro since
+   these calls do not use the PLT.  But this would mean the dynamic
+   loader has no chance to find out when the function is called.  The
+   macro applies the necessary magic so that profiling is possible.
+   Rewrite
+	foo = (*fctp) (arg1, arg2);
+   into
+        foo = DL_CALL_FCT (fctp, (arg1, arg2));
+*/
+# define DL_CALL_FCT(fctp, args) \
+  (_dl_mcount_wrapper_check ((void *) (fctp)), (*(fctp)) args)
+
+__BEGIN_DECLS
+
+/* This function calls the profiling functions.  */
+extern void _dl_mcount_wrapper_check (void *__selfpc) __THROW;
+
+__END_DECLS
+
+#endif

+ 3 - 0
libc/sysdeps/linux/sparc/bits/elfclass.h

@@ -9,3 +9,6 @@
 #include <bits/wordsize.h>
 #include <bits/wordsize.h>
 
 
 #define __ELF_NATIVE_CLASS __WORDSIZE
 #define __ELF_NATIVE_CLASS __WORDSIZE
+
+/* The entries in the .hash table always have a size of 32 bits.  */
+typedef uint32_t Elf_Symndx;

+ 7 - 2
libc/sysdeps/linux/sparc/bits/endian.h

@@ -1,7 +1,12 @@
-/* SPARC is big-endian.  */
+/* Sparc is big-endian, but v9 supports endian conversion on loads/stores
+   and GCC supports such a mode.  Be prepared.  */
 
 
 #ifndef _ENDIAN_H
 #ifndef _ENDIAN_H
 # error "Never use <bits/endian.h> directly; include <endian.h> instead."
 # error "Never use <bits/endian.h> directly; include <endian.h> instead."
 #endif
 #endif
 
 
-#define __BYTE_ORDER __BIG_ENDIAN
+#ifdef __LITTLE_ENDIAN__
+# define __BYTE_ORDER __LITTLE_ENDIAN
+#else
+# define __BYTE_ORDER __BIG_ENDIAN
+#endif

+ 32 - 16
libc/sysdeps/linux/sparc/bits/environments.h

@@ -1,20 +1,20 @@
-/* Copyright (C) 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #ifndef _UNISTD_H
 #ifndef _UNISTD_H
 # error "Never include this file directly.  Use <unistd.h> instead"
 # error "Never include this file directly.  Use <unistd.h> instead"
@@ -27,32 +27,48 @@
    `-1' means it is never supported.  Undefined means it cannot be
    `-1' means it is never supported.  Undefined means it cannot be
    statically decided.
    statically decided.
 
 
-   _XBS5_ILP32_OFF32	32bit int, long, pointers, and off_t type
+   _POSIX_V6_ILP32_OFF32   32bit int, long, pointers, and off_t type
-   _XBS5_ILP32_OFFBIG	32bit int, long, and pointers and larger off_t type
+   _POSIX_V6_ILP32_OFFBIG  32bit int, long, and pointers and larger off_t type
 
 
-   _XBS5_LP64_OFF32	64bit long and pointers and 32bit off_t type
+   _POSIX_V6_LP64_OFF32	   64bit long and pointers and 32bit off_t type
-   _XBS5_LPBIG_OFFBIG	64bit long and pointers and large off_t type
+   _POSIX_V6_LPBIG_OFFBIG  64bit long and pointers and large off_t type
+
+   The macros _XBS5_ILP32_OFF32, _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and
+   _XBS5_LPBIG_OFFBIG were used in previous versions of the Unix standard
+   and are available only for compatibility.
 */
 */
 
 
 #if __WORDSIZE == 64
 #if __WORDSIZE == 64
 
 
 /* We can never provide environments with 32-bit wide pointers.  */
 /* We can never provide environments with 32-bit wide pointers.  */
+# define _POSIX_V6_ILP32_OFF32	-1
+# define _POSIX_V6_ILP32_OFFBIG	-1
 # define _XBS5_ILP32_OFF32	-1
 # define _XBS5_ILP32_OFF32	-1
 # define _XBS5_ILP32_OFFBIG	-1
 # define _XBS5_ILP32_OFFBIG	-1
+/* We also have no use (for now) for an environment with bigger pointers
+   and offsets.  */
+# define _POSIX_V6_LPBIG_OFFBIG	-1
+# define _XBS5_LPBIG_OFFBIG	-1
 
 
 /* By default we have 64-bit wide `long int', pointers and `off_t'.  */
 /* By default we have 64-bit wide `long int', pointers and `off_t'.  */
-# define _XBS5_LP64_OFF32	1
+# define _POSIX_V6_LP64_OFF64	1
-# define _XBS5_LPBIG_OFFBIG	1
+# define _XBS5_LP64_OFF64	1
 
 
 #else /* __WORDSIZE == 32 */
 #else /* __WORDSIZE == 32 */
 
 
-/* By default we have 32-bit wide `int', `long int', pointers and `off_t'.  */
+/* By default we have 32-bit wide `int', `long int', pointers and `off_t'
+   and all platforms support LFS.  */
+# define _POSIX_V6_ILP32_OFF32	1
+# define _POSIX_V6_ILP32_OFFBIG	1
 # define _XBS5_ILP32_OFF32	1
 # define _XBS5_ILP32_OFF32	1
+# define _XBS5_ILP32_OFFBIG	1
 
 
 /* We optionally provide an environment with the above size but an 64-bit
 /* We optionally provide an environment with the above size but an 64-bit
    side `off_t'.  Therefore we don't define _XBS5_ILP32_OFFBIG.  */
    side `off_t'.  Therefore we don't define _XBS5_ILP32_OFFBIG.  */
 
 
 /* We can never provide environments with 64-bit wide pointers.  */
 /* We can never provide environments with 64-bit wide pointers.  */
+# define _POSIX_V6_LP64_OFF64	-1
+# define _POSIX_V6_LPBIG_OFFBIG	-1
 # define _XBS5_LP64_OFF64	-1
 # define _XBS5_LP64_OFF64	-1
 # define _XBS5_LPBIG_OFFBIG	-1
 # define _XBS5_LPBIG_OFFBIG	-1
 
 

+ 12 - 18
libc/sysdeps/linux/sparc/bits/errno.h

@@ -1,21 +1,21 @@
 /* Error constants.  Linux specific version.
 /* Error constants.  Linux specific version.
-   Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #ifdef _ERRNO_H
 #ifdef _ERRNO_H
 
 
@@ -32,14 +32,11 @@
 # define ECANCELED	125
 # define ECANCELED	125
 
 
 # ifndef __ASSEMBLER__
 # ifndef __ASSEMBLER__
-
-__BEGIN_DECLS
-
 /* We now need a declaration of the `errno' variable.  */
 /* We now need a declaration of the `errno' variable.  */
 extern int errno;
 extern int errno;
 
 
 /* Function to get address of global `errno' variable.  */
 /* Function to get address of global `errno' variable.  */
-extern int *__errno_location __P ((void)) __attribute__ ((__const__));
+extern int *__errno_location (void) __THROW __attribute__ ((__const__));
 
 
 #  if defined _LIBC
 #  if defined _LIBC
 /* We wouldn't need a special macro anymore but it is history.  */
 /* We wouldn't need a special macro anymore but it is history.  */
@@ -50,16 +47,13 @@ extern int *__errno_location __P ((void)) __attribute__ ((__const__));
 /* When using threads, errno is a per-thread value.  */
 /* When using threads, errno is a per-thread value.  */
 #   define errno (*__errno_location ())
 #   define errno (*__errno_location ())
 #  endif
 #  endif
-
-__END_DECLS
-
 # endif /* !__ASSEMBLER__ */
 # endif /* !__ASSEMBLER__ */
 #endif /* _ERRNO_H */
 #endif /* _ERRNO_H */
 
 
 #if !defined _ERRNO_H && defined __need_Emath
 #if !defined _ERRNO_H && defined __need_Emath
 /* This is ugly but the kernel header is not clean enough.  We must
 /* This is ugly but the kernel header is not clean enough.  We must
-   define only the values EDOM and ERANGE in case __need_Emath is
+   define only the values EDOM, EILSEQ and ERANGE in case __need_Emath is
-   defined.  The value is the same for all Linux ports.  */
+   defined.  */
 # define EDOM	33	/* Math argument out of domain of function.  */
 # define EDOM	33	/* Math argument out of domain of function.  */
 # define EILSEQ	84	/* Illegal byte sequence.  */
 # define EILSEQ	84	/* Illegal byte sequence.  */
 # define ERANGE	34	/* Math result not representable.  */
 # define ERANGE	34	/* Math result not representable.  */

+ 70 - 18
libc/sysdeps/linux/sparc/bits/fcntl.h

@@ -3,22 +3,23 @@
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
-#ifndef _FCNTLBITS_H
+#ifndef _FCNTL_H
-#define _FCNTLBITS_H	1
+# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
+#endif
 
 
 #include <sys/types.h>
 #include <sys/types.h>
 #include <bits/wordsize.h>
 #include <bits/wordsize.h>
@@ -52,6 +53,14 @@
 # endif
 # endif
 #endif
 #endif
 
 
+/* For now Linux has no synchronisity options for data and read
+   operations.  We define the symbols here but let them do the same as
+   O_SYNC since this is a superset.  */
+#if defined __USE_POSIX199309 || defined __USE_UNIX98
+# define O_DSYNC	O_SYNC	/* Synchronize data.  */
+# define O_RSYNC	O_SYNC	/* Synchronize read operations.  */
+#endif
+
 /* For now Linux has synchronisity options for data and read operations.
 /* For now Linux has synchronisity options for data and read operations.
    We define the symbols here but let them do the same as O_SYNC since
    We define the symbols here but let them do the same as O_SYNC since
    this is a superset.  */
    this is a superset.  */
@@ -66,23 +75,40 @@
 #define F_SETFD		2	/* Set file descriptor flags.  */
 #define F_SETFD		2	/* Set file descriptor flags.  */
 #define F_GETFL		3	/* Get file status flags.  */
 #define F_GETFL		3	/* Get file status flags.  */
 #define F_SETFL		4	/* Set file status flags.  */
 #define F_SETFL		4	/* Set file status flags.  */
-#ifdef __USE_BSD
+#if defined __USE_BSD || defined __USE_XOPEN2K
 # define F_GETOWN	5	/* Get owner of socket (receiver of SIGIO).  */
 # define F_GETOWN	5	/* Get owner of socket (receiver of SIGIO).  */
 # define F_SETOWN	6	/* Set owner of socket (receiver of SIGIO).  */
 # define F_SETOWN	6	/* Set owner of socket (receiver of SIGIO).  */
 #endif
 #endif
-#define F_GETLK		7	/* Get record locking info.  */
+#ifndef __USE_FILE_OFFSET64
-#define F_SETLK		8	/* Set record locking info (non-blocking).  */
+# define F_GETLK	7	/* Get record locking info.  */
-#define F_SETLKW	9	/* Set record locking info (blocking).  */
+# define F_SETLK	8	/* Set record locking info (non-blocking).  */
+# define F_SETLKW	9	/* Set record locking info (blocking).  */
+#else
+# define F_GETLK	F_GETLK64  /* Get record locking info.  */
+# define F_SETLK	F_SETLK64  /* Set record locking info (non-blocking).*/
+# define F_SETLKW	F_SETLKW64 /* Set record locking info (blocking).  */
+#endif
 
 
 #ifdef __USE_GNU
 #ifdef __USE_GNU
 # define F_SETSIG	10	/* Set number of signal to be sent.  */
 # define F_SETSIG	10	/* Set number of signal to be sent.  */
 # define F_GETSIG	11	/* Get number of signal to be sent.  */
 # define F_GETSIG	11	/* Get number of signal to be sent.  */
 #endif
 #endif
 
 
-/* XXX missing */
+#ifdef __USE_GNU
-#define F_GETLK64	7	/* Get record locking info.  */
+# define F_SETLEASE     1024	/* Set a lease.  */
-#define F_SETLK64	8	/* Set record locking info (non-blocking).  */
+# define F_GETLEASE     1025	/* Enquire what lease is active.  */
-#define F_SETLKW64	9	/* Set record locking info (blocking).  */
+# define F_NOTIFY       1026	/* Request notfications on a directory.  */
+#endif
+
+#if __WORDSIZE == 64
+# define F_GETLK64	7	/* Get record locking info.  */
+# define F_SETLK64	8	/* Set record locking info (non-blocking).  */
+# define F_SETLKW64	9	/* Set record locking info (blocking).  */
+#else
+# define F_GETLK64	12	/* Get record locking info.  */
+# define F_SETLK64	13	/* Set record locking info (non-blocking).  */
+# define F_SETLKW64	14	/* Set record locking info (blocking).  */
+#endif
 
 
 /* for F_[GET|SET]FL */
 /* for F_[GET|SET]FL */
 #define FD_CLOEXEC	1	/* actually anything with low bit set goes */
 #define FD_CLOEXEC	1	/* actually anything with low bit set goes */
@@ -105,6 +131,24 @@
 # define LOCK_UN	8	/* remove lock */
 # define LOCK_UN	8	/* remove lock */
 #endif
 #endif
 
 
+#ifdef __USE_GNU
+# define LOCK_MAND	32	/* This is a mandatory flock:	*/
+# define LOCK_READ	64	/* ... which allows concurrent read operations.	 */
+# define LOCK_WRITE	128	/* ... which allows concurrent write operations.  */
+# define LOCK_RW	192	/* ... Which allows concurrent read & write operations.	 */
+#endif
+
+#ifdef __USE_GNU
+/* Types of directory notifications that may be requested with F_NOTIFY.  */
+# define DN_ACCESS	0x00000001	/* File accessed.  */
+# define DN_MODIFY	0x00000002	/* File modified.  */
+# define DN_CREATE	0x00000004	/* File created.  */
+# define DN_DELETE	0x00000008	/* File removed.  */
+# define DN_RENAME	0x00000010	/* File renamed.  */
+# define DN_ATTRIB	0x00000020	/* File changed attibutes.  */
+# define DN_MULTISHOT	0x80000000	/* Don't remove notifier.  */
+#endif
+
 struct flock
 struct flock
   {
   {
     short int l_type;	/* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK.  */
     short int l_type;	/* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK.  */
@@ -142,4 +186,12 @@ struct flock64
 # define FNDELAY	O_NDELAY
 # define FNDELAY	O_NDELAY
 #endif /* Use BSD.  */
 #endif /* Use BSD.  */
 
 
+/* Advise to `posix_fadvise'.  */
+#ifdef __USE_XOPEN2K
+# define POSIX_FADV_NORMAL	0 /* No further special treatment.  */
+# define POSIX_FADV_RANDOM	1 /* Expect random page references.  */
+# define POSIX_FADV_SEQUENTIAL	2 /* Expect sequential page references.  */
+# define POSIX_FADV_WILLNEED	3 /* Will need these pages.  */
+# define POSIX_FADV_DONTNEED	4 /* Don't need these pages.  */
+# define POSIX_FADV_NOREUSE	5 /* Data will be accessed once.  */
 #endif
 #endif

+ 11 - 11
libc/sysdeps/linux/sparc/bits/fenv.h

@@ -1,20 +1,20 @@
-/* Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #ifndef _FENV_H
 #ifndef _FENV_H
 # error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
 # error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
@@ -68,11 +68,11 @@ typedef unsigned long int fexcept_t;
 typedef unsigned long int fenv_t;
 typedef unsigned long int fenv_t;
 
 
 /* If the default argument is used we use this value.  */
 /* If the default argument is used we use this value.  */
-#define FE_DFL_ENV	((fenv_t *) -1)
+#define FE_DFL_ENV	((__const fenv_t *) -1)
 
 
 #ifdef __USE_GNU
 #ifdef __USE_GNU
 /* Floating-point environment where none of the exception is masked.  */
 /* Floating-point environment where none of the exception is masked.  */
-# define FE_NOMASK_ENV	((fenv_t *) -2)
+# define FE_NOMASK_ENV	((__const fenv_t *) -2)
 #endif
 #endif
 
 
 /* For internal use only: access the fp state register.  */
 /* For internal use only: access the fp state register.  */

+ 69 - 34
libc/sysdeps/linux/sparc/bits/huge_val.h

@@ -1,50 +1,52 @@
 /* `HUGE_VAL' constants for IEEE 754 machines (where it is infinity).
 /* `HUGE_VAL' constants for IEEE 754 machines (where it is infinity).
    Used by <stdlib.h> and <math.h> functions for overflow.
    Used by <stdlib.h> and <math.h> functions for overflow.
-   Copyright (C) 1992, 1995, 1996, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1992, 1995, 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #ifndef _MATH_H
 #ifndef _MATH_H
 # error "Never use <bits/huge_val.h> directly; include <math.h> instead."
 # error "Never use <bits/huge_val.h> directly; include <math.h> instead."
 #endif
 #endif
 
 
 #include <features.h>
 #include <features.h>
+#include <bits/wordsize.h>
 
 
 /* IEEE positive infinity (-HUGE_VAL is negative infinity).  */
 /* IEEE positive infinity (-HUGE_VAL is negative infinity).  */
 
 
 #ifdef	__GNUC__
 #ifdef	__GNUC__
 
 
-# define HUGE_VAL \
+# if __GNUC_PREREQ(2,96)
+
+#  define HUGE_VAL (__extension__ 0x1.0p2047)
+
+# else
+
+#  define HUGE_VAL \
   (__extension__							      \
   (__extension__							      \
    ((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; })   \
    ((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; })   \
     { __l: 0x7ff0000000000000ULL }).__d)
     { __l: 0x7ff0000000000000ULL }).__d)
 
 
-#else /* not GCC */
+# endif
 
 
-# include <endian.h>
+#else /* not GCC */
 
 
 typedef union { unsigned char __c[8]; double __d; } __huge_val_t;
 typedef union { unsigned char __c[8]; double __d; } __huge_val_t;
 
 
-# if __BYTE_ORDER == __BIG_ENDIAN
+# define __HUGE_VAL_bytes	{ 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 }
-#  define __HUGE_VAL_bytes	{ 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 }
-# endif
-# if __BYTE_ORDER == __LITTLE_ENDIAN
-#  define __HUGE_VAL_bytes	{ 0, 0, 0, 0, 0, 0, 0xf0, 0x7f }
-# endif
 
 
 static __huge_val_t __huge_val = { __HUGE_VAL_bytes };
 static __huge_val_t __huge_val = { __HUGE_VAL_bytes };
 # define HUGE_VAL	(__huge_val.__d)
 # define HUGE_VAL	(__huge_val.__d)
@@ -52,36 +54,69 @@ static __huge_val_t __huge_val = { __HUGE_VAL_bytes };
 #endif	/* GCC.  */
 #endif	/* GCC.  */
 
 
 
 
-/* ISO C 9X extensions: (float) HUGE_VALF and (long double) HUGE_VALL.  */
+/* ISO C99 extensions: (float) HUGE_VALF and (long double) HUGE_VALL.  */
+
+#ifdef __USE_ISOC99
+
+# if __GNUC_PREREQ(2,96)
 
 
-#ifdef __USE_ISOC9X
+#  define HUGE_VALF (__extension__ 0x1.0p255f)
+#  if __WORDSIZE == 32
+#   define HUGE_VALL HUGE_VAL
+#  else
+/* Sparc64 uses IEEE 754 128bit long double */
+#   define HUGE_VALL (__extension__ 0x1.0p32767L)
+#  endif
+
+# else
 
 
-# ifdef __GNUC__
+#  ifdef __GNUC__
 
 
-#  define HUGE_VALF \
+#   define HUGE_VALF \
   (__extension__							      \
   (__extension__							      \
    ((union { unsigned __l __attribute__((__mode__(__SI__))); float __d; })    \
    ((union { unsigned __l __attribute__((__mode__(__SI__))); float __d; })    \
     { __l: 0x7f800000UL }).__d)
     { __l: 0x7f800000UL }).__d)
 
 
-# else /* not GCC */
+#  else /* not GCC */
 
 
 typedef union { unsigned char __c[4]; float __f; } __huge_valf_t;
 typedef union { unsigned char __c[4]; float __f; } __huge_valf_t;
 
 
-#  if __BYTE_ORDER == __BIG_ENDIAN
 #   define __HUGE_VALF_bytes	{ 0x7f, 0x80, 0, 0 }
 #   define __HUGE_VALF_bytes	{ 0x7f, 0x80, 0, 0 }
-#  endif
-#  if __BYTE_ORDER == __LITTLE_ENDIAN
-#   define __HUGE_VALF_bytes	{ 0, 0, 0x80, 0x7f }
-#  endif
 
 
 static __huge_valf_t __huge_valf = { __HUGE_VALF_bytes };
 static __huge_valf_t __huge_valf = { __HUGE_VALF_bytes };
-#  define HUGE_VALF	(__huge_valf.__f)
+#   define HUGE_VALF	(__huge_valf.__f)
+
+#  endif /* GCC.  */
+
+#  if __WORDSIZE == 32
+
+/* Sparc32 has IEEE 754 64bit long double */
+#   define HUGE_VALL HUGE_VAL
+
+#  else
+
+/* Sparc64 uses IEEE 754 128bit long double */
+
+#   ifdef __GNUC__
 
 
-# endif	/* GCC.  */
+#    define HUGE_VALL \
+  (__extension__									\
+   ((union { struct { unsigned long __h, __l; } __i; long double __d; })		\
+    { __i: { __h: 0x7fff000000000000UL, __l: 0 } }).__d)
 
 
+#   else /* not GCC */
+
+typedef union { unsigned char __c[16]; long double __d; } __huge_vall_t;
+
+#    define __HUGE_VALL_bytes	{ 0x7f, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+
+static __huge_vall_t __huge_vall = { __HUGE_VALL_bytes };
+#    define HUGE_VALL	(__huge_vall.__d)
+
+#   endif /* GCC.  */
+
+#  endif
 
 
-/* Generally there is no separate `long double' format and it is the
+# endif /* GCC 2.95.  */
-   same as `double'.  */
-# define HUGE_VALL HUGE_VAL
 
 
-#endif /* __USE_ISOC9X.  */
+#endif /* __USE_ISOC99.  */

+ 27 - 14
libc/sysdeps/linux/sparc/bits/in.h

@@ -1,20 +1,20 @@
-/* Copyright (C) 1991,92,93,94,95,96,97,98,99 Free Software Foundation, Inc.
+/* Copyright (C) 1991-1999, 2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 /* Linux version.  */
 /* Linux version.  */
 
 
@@ -99,7 +99,7 @@ struct in_pktinfo
 #define IPV6_PKTINFO		2
 #define IPV6_PKTINFO		2
 #define IPV6_HOPOPTS		3
 #define IPV6_HOPOPTS		3
 #define IPV6_DSTOPTS		4
 #define IPV6_DSTOPTS		4
-#define IPV6_RXSRCRT		5
+#define IPV6_RTHDR		5
 #define IPV6_PKTOPTIONS		6
 #define IPV6_PKTOPTIONS		6
 #define IPV6_CHECKSUM		7
 #define IPV6_CHECKSUM		7
 #define IPV6_HOPLIMIT		8
 #define IPV6_HOPLIMIT		8
@@ -109,14 +109,21 @@ struct in_pktinfo
 #define IPV6_MULTICAST_IF	17
 #define IPV6_MULTICAST_IF	17
 #define IPV6_MULTICAST_HOPS	18
 #define IPV6_MULTICAST_HOPS	18
 #define IPV6_MULTICAST_LOOP	19
 #define IPV6_MULTICAST_LOOP	19
-#define IPV6_ADD_MEMBERSHIP	20
+#define IPV6_JOIN_GROUP		20
-#define IPV6_DROP_MEMBERSHIP	21
+#define IPV6_LEAVE_GROUP	21
 #define IPV6_ROUTER_ALERT	22
 #define IPV6_ROUTER_ALERT	22
+#define IPV6_MTU_DISCOVER	23
+#define IPV6_MTU		24
+#define IPV6_RECVERR		25
 
 
 #define SCM_SRCRT		IPV6_RXSRCRT
 #define SCM_SRCRT		IPV6_RXSRCRT
 
 
-#define IPV6_RXHOPOPTS		IPV6_HOPOPTS	/* obsolete name */
+/* Obsolete synonyms for the above.  */
-#define IPV6_RXDSTOPTS		IPV6_DSTOPTS	/* obsolete name */
+#define IPV6_RXHOPOPTS		IPV6_HOPOPTS
+#define IPV6_RXDSTOPTS		IPV6_DSTOPTS
+#define IPV6_ADD_MEMBERSHIP	IPV6_JOIN_GROUP
+#define IPV6_DROP_MEMBERSHIP	IPV6_LEAVE_GROUP
+
 
 
 /* IPV6_MTU_DISCOVER values.  */
 /* IPV6_MTU_DISCOVER values.  */
 #define IPV6_PMTUDISC_DONT	0	/* Never send DF frames.  */
 #define IPV6_PMTUDISC_DONT	0	/* Never send DF frames.  */
@@ -126,3 +133,9 @@ struct in_pktinfo
 /* Socket level values for IPv6.  */
 /* Socket level values for IPv6.  */
 #define SOL_IPV6        41
 #define SOL_IPV6        41
 #define SOL_ICMPV6      58
 #define SOL_ICMPV6      58
+
+/* Routing header options for IPv6.  */
+#define IPV6_RTHDR_LOOSE	0	/* Hop doesn't need to be neighbour. */
+#define IPV6_RTHDR_STRICT	1	/* Hop must be a neighbour.  */
+
+#define IPV6_RTHDR_TYPE_0	0	/* IPv6 Routing header type 0.  */

+ 10 - 9
libc/sysdeps/linux/sparc/bits/ioctl-types.h

@@ -1,21 +1,21 @@
 /* Structure types for pre-termios terminal ioctls.  Linux version.
 /* Structure types for pre-termios terminal ioctls.  Linux version.
-   Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 1999, 2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #ifndef _SYS_IOCTL_H
 #ifndef _SYS_IOCTL_H
 # error "Never use <bits/ioctl-types.h> directly; include <sys/ioctl.h> instead."
 # error "Never use <bits/ioctl-types.h> directly; include <sys/ioctl.h> instead."
@@ -75,3 +75,4 @@ struct termio
 #define N_SMSBLOCK	12	/* SMS block mode  */
 #define N_SMSBLOCK	12	/* SMS block mode  */
 #define N_HDLC		13	/* synchronous HDLC  */
 #define N_HDLC		13	/* synchronous HDLC  */
 #define N_SYNC_PPP	14	/* synchronous PPP  */
 #define N_SYNC_PPP	14	/* synchronous PPP  */
+#define	N_HCI		15	/* Bluetooth HCI UART  */

+ 8 - 8
libc/sysdeps/linux/sparc/bits/ioctls.h

@@ -2,19 +2,19 @@
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #ifndef _SYS_IOCTL_H
 #ifndef _SYS_IOCTL_H
 # error "Never use <bits/ioctls.h> directly; include <sys/ioctl.h> instead."
 # error "Never use <bits/ioctls.h> directly; include <sys/ioctl.h> instead."

+ 27 - 15
libc/sysdeps/linux/sparc/bits/ipc.h

@@ -1,26 +1,27 @@
-/* Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1995-1999, 2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #ifndef _SYS_IPC_H
 #ifndef _SYS_IPC_H
 # error "Never use <bits/ipc.h> directly; include <sys/ipc.h> instead."
 # error "Never use <bits/ipc.h> directly; include <sys/ipc.h> instead."
 #endif
 #endif
 
 
-#include <sys/types.h>
+#include <bits/types.h>
+#include <bits/wordsize.h>
 
 
 /* Mode bits for `msgget', `semget', and `shmget'.  */
 /* Mode bits for `msgget', `semget', and `shmget'.  */
 #define IPC_CREAT	01000		/* Create key if key does not exist. */
 #define IPC_CREAT	01000		/* Create key if key does not exist. */
@@ -31,7 +32,9 @@
 #define IPC_RMID	0		/* Remove identifier.  */
 #define IPC_RMID	0		/* Remove identifier.  */
 #define IPC_SET		1		/* Set `ipc_perm' options.  */
 #define IPC_SET		1		/* Set `ipc_perm' options.  */
 #define IPC_STAT	2		/* Get `ipc_perm' options.  */
 #define IPC_STAT	2		/* Get `ipc_perm' options.  */
-#define IPC_INFO	3		/* See ipcs.  */
+#ifdef __USE_GNU
+# define IPC_INFO	3		/* See ipcs.  */
+#endif
 
 
 /* Special key values.  */
 /* Special key values.  */
 #define IPC_PRIVATE	((__key_t) 0)	/* Private key.  */
 #define IPC_PRIVATE	((__key_t) 0)	/* Private key.  */
@@ -41,10 +44,19 @@
 struct ipc_perm
 struct ipc_perm
   {
   {
     __key_t __key;			/* Key.  */
     __key_t __key;			/* Key.  */
-    unsigned short int uid;		/* Owner's user ID.  */
+    __uid_t uid;			/* Owner's user ID.  */
-    unsigned short int gid;		/* Owner's group ID.  */
+    __gid_t gid;			/* Owner's group ID.  */
-    unsigned short int cuid;		/* Creator's user ID.  */
+    __uid_t cuid;			/* Creator's user ID.  */
-    unsigned short int cgid;		/* Creator's group ID.  */
+    __gid_t cgid;			/* Creator's group ID.  */
+#if __WORDSIZE == 32
+    unsigned short int __pad1;
     unsigned short int mode;		/* Read/write permission.  */
     unsigned short int mode;		/* Read/write permission.  */
+    unsigned short int __pad2;
+#else
+    __mode_t mode;			/* Read/write permission.  */
+    unsigned short int __pad1;
+#endif
     unsigned short int __seq;		/* Sequence number.  */
     unsigned short int __seq;		/* Sequence number.  */
+    unsigned long long int __unused1;
+    unsigned long long int __unused2;
   };
   };

+ 144 - 31
libc/sysdeps/linux/sparc/bits/libc-lock.h

@@ -1,5 +1,5 @@
 /* libc-internal interface for mutex locks.  LinuxThreads version.
 /* libc-internal interface for mutex locks.  LinuxThreads version.
-   Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
@@ -23,10 +23,18 @@
 #include <pthread.h>
 #include <pthread.h>
 
 
 /* Mutex type.  */
 /* Mutex type.  */
-#ifdef _LIBC
+#if defined(_LIBC) || defined(_IO_MTSAFE_IO)
 typedef pthread_mutex_t __libc_lock_t;
 typedef pthread_mutex_t __libc_lock_t;
+typedef struct { pthread_mutex_t mutex; } __libc_lock_recursive_t;
+# ifdef __USE_UNIX98
+typedef pthread_rwlock_t __libc_rwlock_t;
+# else
+typedef struct __libc_rwlock_opaque__ __libc_rwlock_t;
+# endif
 #else
 #else
 typedef struct __libc_lock_opaque__ __libc_lock_t;
 typedef struct __libc_lock_opaque__ __libc_lock_t;
+typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
+typedef struct __libc_rwlock_opaque__ __libc_rwlock_t;
 #endif
 #endif
 
 
 /* Type for key to thread-specific data.  */
 /* Type for key to thread-specific data.  */
@@ -41,25 +49,44 @@ typedef pthread_key_t __libc_key_t;
    of libc.  */
    of libc.  */
 #define __libc_lock_define(CLASS,NAME) \
 #define __libc_lock_define(CLASS,NAME) \
   CLASS __libc_lock_t NAME;
   CLASS __libc_lock_t NAME;
+#define __libc_rwlock_define(CLASS,NAME) \
+  CLASS __libc_rwlock_t NAME;
+#define __libc_lock_define_recursive(CLASS,NAME) \
+  CLASS __libc_lock_recursive_t NAME;
 
 
 /* Define an initialized lock variable NAME with storage class CLASS.
 /* Define an initialized lock variable NAME with storage class CLASS.
 
 
-   For the C library we take a deeper look at the initializer.  For this
+   For the C library we take a deeper look at the initializer.  For
-   implementation all fields are initialized to zero.  Therefore we
+   this implementation all fields are initialized to zero.  Therefore
-   don't initialize the variable which allows putting it into the BSS
+   we don't initialize the variable which allows putting it into the
-   section.  */
+   BSS section.  (Except on PA-RISC and other odd architectures, where
-#define __libc_lock_define_initialized(CLASS,NAME) \
+   initialized locks must be set to one due to the lack of normal
+   atomic operations.) */
+
+#if __LT_SPINLOCK_INIT == 0
+#  define __libc_lock_define_initialized(CLASS,NAME) \
   CLASS __libc_lock_t NAME;
   CLASS __libc_lock_t NAME;
+#else
+#  define __libc_lock_define_initialized(CLASS,NAME) \
+  CLASS __libc_lock_t NAME = PTHREAD_MUTEX_INITIALIZER;
+#endif
+
+#define __libc_rwlock_define_initialized(CLASS,NAME) \
+  CLASS __libc_rwlock_t NAME = PTHREAD_RWLOCK_INITIALIZER;
 
 
 /* Define an initialized recursive lock variable NAME with storage
 /* Define an initialized recursive lock variable NAME with storage
    class CLASS.  */
    class CLASS.  */
 #define __libc_lock_define_initialized_recursive(CLASS,NAME) \
 #define __libc_lock_define_initialized_recursive(CLASS,NAME) \
-  CLASS __libc_lock_t NAME = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
+  CLASS __libc_lock_recursive_t NAME = _LIBC_LOCK_RECURSIVE_INITIALIZER;
+#define _LIBC_LOCK_RECURSIVE_INITIALIZER \
+  {PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP}
 
 
 /* Initialize the named lock variable, leaving it in a consistent, unlocked
 /* Initialize the named lock variable, leaving it in a consistent, unlocked
    state.  */
    state.  */
 #define __libc_lock_init(NAME) \
 #define __libc_lock_init(NAME) \
   (__pthread_mutex_init != NULL ? __pthread_mutex_init (&(NAME), NULL) : 0);
   (__pthread_mutex_init != NULL ? __pthread_mutex_init (&(NAME), NULL) : 0);
+#define __libc_rwlock_init(NAME) \
+  (__pthread_rwlock_init != NULL ? __pthread_rwlock_init (&(NAME), NULL) : 0);
 
 
 /* Same as last but this time we initialize a recursive mutex.  */
 /* Same as last but this time we initialize a recursive mutex.  */
 #define __libc_lock_init_recursive(NAME) \
 #define __libc_lock_init_recursive(NAME) \
@@ -69,7 +96,7 @@ typedef pthread_key_t __libc_key_t;
 	pthread_mutexattr_t __attr;					      \
 	pthread_mutexattr_t __attr;					      \
 	__pthread_mutexattr_init (&__attr);				      \
 	__pthread_mutexattr_init (&__attr);				      \
 	__pthread_mutexattr_settype (&__attr, PTHREAD_MUTEX_RECURSIVE_NP); \
 	__pthread_mutexattr_settype (&__attr, PTHREAD_MUTEX_RECURSIVE_NP); \
-	__pthread_mutex_init (&(NAME), &__attr);			      \
+	__pthread_mutex_init (&(NAME).mutex, &__attr);			      \
 	__pthread_mutexattr_destroy (&__attr);				      \
 	__pthread_mutexattr_destroy (&__attr);				      \
       }									      \
       }									      \
   } while (0);
   } while (0);
@@ -79,30 +106,44 @@ typedef pthread_key_t __libc_key_t;
    called on a lock variable before the containing storage is reused.  */
    called on a lock variable before the containing storage is reused.  */
 #define __libc_lock_fini(NAME) \
 #define __libc_lock_fini(NAME) \
   (__pthread_mutex_destroy != NULL ? __pthread_mutex_destroy (&(NAME)) : 0);
   (__pthread_mutex_destroy != NULL ? __pthread_mutex_destroy (&(NAME)) : 0);
+#define __libc_rwlock_fini(NAME) \
+  (__pthread_rwlock_destroy != NULL ? __pthread_rwlock_destroy (&(NAME)) : 0);
 
 
 /* Finalize recursive named lock.  */
 /* Finalize recursive named lock.  */
-#define __libc_lock_fini_recursive(NAME) __libc_lock_fini (NAME)
+#define __libc_lock_fini_recursive(NAME) __libc_lock_fini ((NAME).mutex)
 
 
 /* Lock the named lock variable.  */
 /* Lock the named lock variable.  */
 #define __libc_lock_lock(NAME) \
 #define __libc_lock_lock(NAME) \
   (__pthread_mutex_lock != NULL ? __pthread_mutex_lock (&(NAME)) : 0);
   (__pthread_mutex_lock != NULL ? __pthread_mutex_lock (&(NAME)) : 0);
+#define __libc_rwlock_rdlock(NAME) \
+  (__pthread_rwlock_rdlock != NULL ? __pthread_rwlock_rdlock (&(NAME)) : 0);
+#define __libc_rwlock_wrlock(NAME) \
+  (__pthread_rwlock_wrlock != NULL ? __pthread_rwlock_wrlock (&(NAME)) : 0);
 
 
 /* Lock the recursive named lock variable.  */
 /* Lock the recursive named lock variable.  */
-#define __libc_lock_lock_recursive(NAME) __libc_lock_lock (NAME)
+#define __libc_lock_lock_recursive(NAME) __libc_lock_lock ((NAME).mutex)
 
 
 /* Try to lock the named lock variable.  */
 /* Try to lock the named lock variable.  */
 #define __libc_lock_trylock(NAME) \
 #define __libc_lock_trylock(NAME) \
   (__pthread_mutex_trylock != NULL ? __pthread_mutex_trylock (&(NAME)) : 0)
   (__pthread_mutex_trylock != NULL ? __pthread_mutex_trylock (&(NAME)) : 0)
+#define __libc_rwlock_tryrdlock(NAME) \
+  (__pthread_rwlock_tryrdlock != NULL \
+   ? __pthread_rwlock_tryrdlock (&(NAME)) : 0)
+#define __libc_rwlock_trywrlock(NAME) \
+  (__pthread_rwlock_trywrlock != NULL \
+   ? __pthread_rwlock_trywrlock (&(NAME)) : 0)
 
 
 /* Try to lock the recursive named lock variable.  */
 /* Try to lock the recursive named lock variable.  */
-#define __libc_lock_trylock_recursive(NAME) __libc_lock_trylock (NAME)
+#define __libc_lock_trylock_recursive(NAME) __libc_lock_trylock ((NAME).mutex)
 
 
 /* Unlock the named lock variable.  */
 /* Unlock the named lock variable.  */
 #define __libc_lock_unlock(NAME) \
 #define __libc_lock_unlock(NAME) \
   (__pthread_mutex_unlock != NULL ? __pthread_mutex_unlock (&(NAME)) : 0);
   (__pthread_mutex_unlock != NULL ? __pthread_mutex_unlock (&(NAME)) : 0);
+#define __libc_rwlock_unlock(NAME) \
+  (__pthread_rwlock_unlock != NULL ? __pthread_rwlock_unlock (&(NAME)) : 0);
 
 
 /* Unlock the recursive named lock variable.  */
 /* Unlock the recursive named lock variable.  */
-#define __libc_lock_unlock_recursive(NAME) __libc_lock_unlock (NAME)
+#define __libc_lock_unlock_recursive(NAME) __libc_lock_unlock ((NAME).mutex)
 
 
 
 
 /* Define once control variable.  */
 /* Define once control variable.  */
@@ -121,17 +162,17 @@ typedef pthread_key_t __libc_key_t;
   do {									      \
   do {									      \
     if (__pthread_once != NULL)						      \
     if (__pthread_once != NULL)						      \
       __pthread_once (&(ONCE_CONTROL), (INIT_FUNCTION));		      \
       __pthread_once (&(ONCE_CONTROL), (INIT_FUNCTION));		      \
-    else if ((ONCE_CONTROL) == 0) {					      \
+    else if ((ONCE_CONTROL) == PTHREAD_ONCE_INIT) {			      \
       INIT_FUNCTION ();							      \
       INIT_FUNCTION ();							      \
-      (ONCE_CONTROL) = 1;						      \
+      (ONCE_CONTROL) = !PTHREAD_ONCE_INIT;				      \
     }									      \
     }									      \
   } while (0)
   } while (0)
 
 
 
 
 /* Start critical region with cleanup.  */
 /* Start critical region with cleanup.  */
-#define __libc_cleanup_region_start(FCT, ARG) \
+#define __libc_cleanup_region_start(DOIT, FCT, ARG) \
   { struct _pthread_cleanup_buffer _buffer;				      \
   { struct _pthread_cleanup_buffer _buffer;				      \
-    int _avail = _pthread_cleanup_push_defer != NULL;			      \
+    int _avail = (DOIT) && _pthread_cleanup_push_defer != NULL;		      \
     if (_avail) {							      \
     if (_avail) {							      \
       _pthread_cleanup_push_defer (&_buffer, (FCT), (ARG));		      \
       _pthread_cleanup_push_defer (&_buffer, (FCT), (ARG));		      \
     }
     }
@@ -166,27 +207,93 @@ typedef pthread_key_t __libc_key_t;
 #define __libc_atfork(PREPARE, PARENT, CHILD) \
 #define __libc_atfork(PREPARE, PARENT, CHILD) \
   (__pthread_atfork != NULL ? __pthread_atfork (PREPARE, PARENT, CHILD) : 0)
   (__pthread_atfork != NULL ? __pthread_atfork (PREPARE, PARENT, CHILD) : 0)
 
 
+/* Functions that are used by this file and are internal to the GNU C
+   library.  */
+
+extern int __pthread_mutex_init (pthread_mutex_t *__mutex,
+				 __const pthread_mutexattr_t *__mutex_attr);
+
+extern int __pthread_mutex_destroy (pthread_mutex_t *__mutex);
+
+extern int __pthread_mutex_trylock (pthread_mutex_t *__mutex);
+
+extern int __pthread_mutex_lock (pthread_mutex_t *__mutex);
+
+extern int __pthread_mutex_unlock (pthread_mutex_t *__mutex);
+
+extern int __pthread_mutexattr_init (pthread_mutexattr_t *__attr);
+
+extern int __pthread_mutexattr_destroy (pthread_mutexattr_t *__attr);
+
+extern int __pthread_mutexattr_settype (pthread_mutexattr_t *__attr,
+					int __kind);
+
+#ifdef __USE_UNIX98
+extern int __pthread_rwlock_init (pthread_rwlock_t *__rwlock,
+				  __const pthread_rwlockattr_t *__attr);
+
+extern int __pthread_rwlock_destroy (pthread_rwlock_t *__rwlock);
+
+extern int __pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock);
+
+extern int __pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock);
+
+extern int __pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock);
+
+extern int __pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock);
+
+extern int __pthread_rwlock_unlock (pthread_rwlock_t *__rwlock);
+#endif
+
+extern int __pthread_key_create (pthread_key_t *__key,
+				 void (*__destr_function) (void *));
+
+extern int __pthread_setspecific (pthread_key_t __key,
+				  __const void *__pointer);
+
+extern void *__pthread_getspecific (pthread_key_t __key);
+
+extern int __pthread_once (pthread_once_t *__once_control,
+			   void (*__init_routine) (void));
+
+extern int __pthread_atfork (void (*__prepare) (void),
+			     void (*__parent) (void),
+			     void (*__child) (void));
+
+
 
 
 /* Make the pthread functions weak so that we can elide them from
 /* Make the pthread functions weak so that we can elide them from
    single-threaded processes.  */
    single-threaded processes.  */
 #ifndef __NO_WEAK_PTHREAD_ALIASES
 #ifndef __NO_WEAK_PTHREAD_ALIASES
 # ifdef weak_extern
 # ifdef weak_extern
-weak_extern (__pthread_mutex_init)
+#  if _LIBC
-weak_extern (__pthread_mutex_destroy)
+#   include <bp-sym.h>
-weak_extern (__pthread_mutex_lock)
+#  else
-weak_extern (__pthread_mutex_trylock)
+#   define BP_SYM (sym) sym
-weak_extern (__pthread_mutex_unlock)
+#  endif
-weak_extern (__pthread_mutexattr_init)
+weak_extern (BP_SYM (__pthread_mutex_init))
-weak_extern (__pthread_mutexattr_destroy)
+weak_extern (BP_SYM (__pthread_mutex_destroy))
-weak_extern (__pthread_mutexattr_settype)
+weak_extern (BP_SYM (__pthread_mutex_lock))
-weak_extern (__pthread_key_create)
+weak_extern (BP_SYM (__pthread_mutex_trylock))
-weak_extern (__pthread_setspecific)
+weak_extern (BP_SYM (__pthread_mutex_unlock))
-weak_extern (__pthread_getspecific)
+weak_extern (BP_SYM (__pthread_mutexattr_init))
-weak_extern (__pthread_once)
+weak_extern (BP_SYM (__pthread_mutexattr_destroy))
+weak_extern (BP_SYM (__pthread_mutexattr_settype))
+weak_extern (BP_SYM (__pthread_rwlock_init))
+weak_extern (BP_SYM (__pthread_rwlock_destroy))
+weak_extern (BP_SYM (__pthread_rwlock_rdlock))
+weak_extern (BP_SYM (__pthread_rwlock_tryrdlock))
+weak_extern (BP_SYM (__pthread_rwlock_wrlock))
+weak_extern (BP_SYM (__pthread_rwlock_trywrlock))
+weak_extern (BP_SYM (__pthread_rwlock_unlock))
+weak_extern (BP_SYM (__pthread_key_create))
+weak_extern (BP_SYM (__pthread_setspecific))
+weak_extern (BP_SYM (__pthread_getspecific))
+weak_extern (BP_SYM (__pthread_once))
 weak_extern (__pthread_initialize)
 weak_extern (__pthread_initialize)
 weak_extern (__pthread_atfork)
 weak_extern (__pthread_atfork)
-weak_extern (_pthread_cleanup_push_defer)
+weak_extern (BP_SYM (_pthread_cleanup_push_defer))
-weak_extern (_pthread_cleanup_pop_restore)
+weak_extern (BP_SYM (_pthread_cleanup_pop_restore))
 # else
 # else
 #  pragma weak __pthread_mutex_init
 #  pragma weak __pthread_mutex_init
 #  pragma weak __pthread_mutex_destroy
 #  pragma weak __pthread_mutex_destroy
@@ -196,6 +303,12 @@ weak_extern (_pthread_cleanup_pop_restore)
 #  pragma weak __pthread_mutexattr_init
 #  pragma weak __pthread_mutexattr_init
 #  pragma weak __pthread_mutexattr_destroy
 #  pragma weak __pthread_mutexattr_destroy
 #  pragma weak __pthread_mutexattr_settype
 #  pragma weak __pthread_mutexattr_settype
+#  pragma weak __pthread_rwlock_destroy
+#  pragma weak __pthread_rwlock_rdlock
+#  pragma weak __pthread_rwlock_tryrdlock
+#  pragma weak __pthread_rwlock_wrlock
+#  pragma weak __pthread_rwlock_trywrlock
+#  pragma weak __pthread_rwlock_unlock
 #  pragma weak __pthread_key_create
 #  pragma weak __pthread_key_create
 #  pragma weak __pthread_setspecific
 #  pragma weak __pthread_setspecific
 #  pragma weak __pthread_getspecific
 #  pragma weak __pthread_getspecific

+ 25 - 3
libc/sysdeps/linux/sparc/bits/local_lim.h

@@ -1,5 +1,5 @@
 /* Minimum guaranteed maximum values for system limits.  Linux version.
 /* Minimum guaranteed maximum values for system limits.  Linux version.
-   Copyright (C) 1993, 94, 95, 96, 97, 98 Free Software Foundation, Inc.
+   Copyright (C) 1993, 94, 95, 96, 97, 98, 2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
@@ -17,11 +17,20 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
    Boston, MA 02111-1307, USA.  */
 
 
-/* The kernel header pollutes the namespace with the NR_OPEN symbol.
+/* The kernel header pollutes the namespace with the NR_OPEN symbol
-   Remove this after including the header if necessary.  */
+   and defines LINK_MAX although filesystems have different maxima.  A
+   similar thing is true for OPEN_MAX: the limit can be changed at
+   runtime and therefore the macro must not be defined.  Remove this
+   after including the header if necessary.  */
 #ifndef NR_OPEN
 #ifndef NR_OPEN
 # define __undef_NR_OPEN
 # define __undef_NR_OPEN
 #endif
 #endif
+#ifndef LINK_MAX
+# define __undef_LINK_MAX
+#endif
+#ifndef OPEN_MAX
+# define __undef_OPEN_MAX
+#endif
 
 
 /* The kernel sources contain a file with all the needed information.  */
 /* The kernel sources contain a file with all the needed information.  */
 #include <linux/limits.h>
 #include <linux/limits.h>
@@ -31,6 +40,16 @@
 # undef NR_OPEN
 # undef NR_OPEN
 # undef __undef_NR_OPEN
 # undef __undef_NR_OPEN
 #endif
 #endif
+/* Have to remove LINK_MAX?  */
+#ifdef __undef_LINK_MAX
+# undef LINK_MAX
+# undef __undef_LINK_MAX
+#endif
+/* Have to remove OPEN_MAX?  */
+#ifdef __undef_OPEN_MAX
+# undef OPEN_MAX
+# undef __undef_OPEN_MAX
+#endif
 
 
 /* The number of data keys per process.  */
 /* The number of data keys per process.  */
 #define _POSIX_THREAD_KEYS_MAX	128
 #define _POSIX_THREAD_KEYS_MAX	128
@@ -53,3 +72,6 @@
 
 
 /* Minimum size for a thread.  We are free to choose a reasonable value.  */
 /* Minimum size for a thread.  We are free to choose a reasonable value.  */
 #define PTHREAD_STACK_MIN	16384
 #define PTHREAD_STACK_MIN	16384
+
+/* Maximum number of POSIX timers available.  */
+#define TIMER_MAX	256

+ 26 - 29
libc/sysdeps/linux/sparc/bits/mathcalls.h

@@ -1,21 +1,21 @@
 /* Prototype declarations for math functions; helper file for <math.h>.
 /* Prototype declarations for math functions; helper file for <math.h>.
-   Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 /* NOTE: Because of the special way this file is used by <math.h>, this
 /* NOTE: Because of the special way this file is used by <math.h>, this
    file must NOT be protected from multiple inclusion as header files
    file must NOT be protected from multiple inclusion as header files
@@ -81,7 +81,7 @@ __MATHCALL (sinh,, (_Mdouble_ __x));
 /* Hyperbolic tangent of X.  */
 /* Hyperbolic tangent of X.  */
 __MATHCALL (tanh,, (_Mdouble_ __x));
 __MATHCALL (tanh,, (_Mdouble_ __x));
 
 
-#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC9X
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
 /* Hyperbolic arc cosine of X.  */
 /* Hyperbolic arc cosine of X.  */
 __MATHCALL (acosh,, (_Mdouble_ __x));
 __MATHCALL (acosh,, (_Mdouble_ __x));
 /* Hyperbolic arc sine of X.  */
 /* Hyperbolic arc sine of X.  */
@@ -117,7 +117,7 @@ __MATHCALL (log10,, (_Mdouble_ __x));
 /* Break VALUE into integral and fractional parts.  */
 /* Break VALUE into integral and fractional parts.  */
 __MATHCALL (modf,, (_Mdouble_ __x, _Mdouble_ *__iptr));
 __MATHCALL (modf,, (_Mdouble_ __x, _Mdouble_ *__iptr));
 
 
-#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC9X
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
 /* Return exp(X) - 1.  */
 /* Return exp(X) - 1.  */
 __MATHCALL (expm1,, (_Mdouble_ __x));
 __MATHCALL (expm1,, (_Mdouble_ __x));
 
 
@@ -128,7 +128,7 @@ __MATHCALL (log1p,, (_Mdouble_ __x));
 __MATHCALL (logb,, (_Mdouble_ __x));
 __MATHCALL (logb,, (_Mdouble_ __x));
 #endif
 #endif
 
 
-#ifdef __USE_ISOC9X
+#ifdef __USE_ISOC99
 /* Compute base-2 exponential of X.  */
 /* Compute base-2 exponential of X.  */
 __MATHCALL (exp2,, (_Mdouble_ __x));
 __MATHCALL (exp2,, (_Mdouble_ __x));
 
 
@@ -145,12 +145,12 @@ __MATHCALL (pow,, (_Mdouble_ __x, _Mdouble_ __y));
 /* Return the square root of X.  */
 /* Return the square root of X.  */
 __MATHCALL (sqrt,, (_Mdouble_ __x));
 __MATHCALL (sqrt,, (_Mdouble_ __x));
 
 
-#if defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC9X
+#if defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC99
 /* Return `sqrt(X*X + Y*Y)'.  */
 /* Return `sqrt(X*X + Y*Y)'.  */
 __MATHCALL (hypot,, (_Mdouble_ __x, _Mdouble_ __y));
 __MATHCALL (hypot,, (_Mdouble_ __x, _Mdouble_ __y));
 #endif
 #endif
 
 
-#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC9X
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
 /* Return the cube root of X.  */
 /* Return the cube root of X.  */
 __MATHCALL (cbrt,, (_Mdouble_ __x));
 __MATHCALL (cbrt,, (_Mdouble_ __x));
 #endif
 #endif
@@ -186,14 +186,6 @@ __MATHDECL_1 (int,isinf,, (_Mdouble_ __value)) __attribute__ ((__const__));
 /* Return nonzero if VALUE is finite and not NaN.  */
 /* Return nonzero if VALUE is finite and not NaN.  */
 __MATHDECL_1 (int,finite,, (_Mdouble_ __value)) __attribute__ ((__const__));
 __MATHDECL_1 (int,finite,, (_Mdouble_ __value)) __attribute__ ((__const__));
 
 
-/* Deal with an infinite or NaN result.
-   If ERROR is ERANGE, result is +Inf;
-   if ERROR is - ERANGE, result is -Inf;
-   otherwise result is NaN.
-   This will set `errno' to either ERANGE or EDOM,
-   and may return an infinity or NaN, or may do something else.  */
-__MATHCALLX (infnan,, (int __error), (__const__));
-
 /* Return the remainder of X/Y.  */
 /* Return the remainder of X/Y.  */
 __MATHCALL (drem,, (_Mdouble_ __x, _Mdouble_ __y));
 __MATHCALL (drem,, (_Mdouble_ __x, _Mdouble_ __y));
 
 
@@ -202,12 +194,12 @@ __MATHCALL (drem,, (_Mdouble_ __x, _Mdouble_ __y));
 __MATHCALL (significand,, (_Mdouble_ __x));
 __MATHCALL (significand,, (_Mdouble_ __x));
 #endif /* Use misc.  */
 #endif /* Use misc.  */
 
 
-#if defined __USE_MISC || defined __USE_ISOC9X
+#if defined __USE_MISC || defined __USE_ISOC99
 /* Return X with its signed changed to Y's.  */
 /* Return X with its signed changed to Y's.  */
 __MATHCALLX (copysign,, (_Mdouble_ __x, _Mdouble_ __y), (__const__));
 __MATHCALLX (copysign,, (_Mdouble_ __x, _Mdouble_ __y), (__const__));
 #endif
 #endif
 
 
-#ifdef __USE_ISOC9X
+#ifdef __USE_ISOC99
 /* Return representation of NaN for double type.  */
 /* Return representation of NaN for double type.  */
 __MATHCALLX (nan,, (__const char *__tagb), (__const__));
 __MATHCALLX (nan,, (__const char *__tagb), (__const__));
 #endif
 #endif
@@ -230,11 +222,14 @@ __MATHCALL (yn,, (int, _Mdouble_));
 #endif
 #endif
 
 
 
 
-#if defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC9X
+#if defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC99
 /* Error and gamma functions.  */
 /* Error and gamma functions.  */
 __MATHCALL (erf,, (_Mdouble_));
 __MATHCALL (erf,, (_Mdouble_));
 __MATHCALL (erfc,, (_Mdouble_));
 __MATHCALL (erfc,, (_Mdouble_));
 __MATHCALL (lgamma,, (_Mdouble_));
 __MATHCALL (lgamma,, (_Mdouble_));
+#endif
+
+#ifdef __USE_ISOC99
 __MATHCALL (tgamma,, (_Mdouble_));
 __MATHCALL (tgamma,, (_Mdouble_));
 #endif
 #endif
 
 
@@ -251,14 +246,14 @@ __MATHCALL (lgamma,_r, (_Mdouble_, int *__signgamp));
 #endif
 #endif
 
 
 
 
-#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC9X
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
 /* Return the integer nearest X in the direction of the
 /* Return the integer nearest X in the direction of the
    prevailing rounding mode.  */
    prevailing rounding mode.  */
 __MATHCALL (rint,, (_Mdouble_ __x));
 __MATHCALL (rint,, (_Mdouble_ __x));
 
 
 /* Return X + epsilon if X < Y, X - epsilon if X > Y.  */
 /* Return X + epsilon if X < Y, X - epsilon if X > Y.  */
 __MATHCALLX (nextafter,, (_Mdouble_ __x, _Mdouble_ __y), (__const__));
 __MATHCALLX (nextafter,, (_Mdouble_ __x, _Mdouble_ __y), (__const__));
-# ifdef __USE_ISOC9X
+# ifdef __USE_ISOC99
 __MATHCALLX (nexttoward,, (_Mdouble_ __x, long double __y), (__const__));
 __MATHCALLX (nexttoward,, (_Mdouble_ __x, long double __y), (__const__));
 # endif
 # endif
 
 
@@ -270,14 +265,16 @@ __MATHCALL (remainder,, (_Mdouble_ __x, _Mdouble_ __y));
 __MATHCALL (scalb,, (_Mdouble_ __x, _Mdouble_ __n));
 __MATHCALL (scalb,, (_Mdouble_ __x, _Mdouble_ __n));
 # endif
 # endif
 
 
+# if defined __USE_MISC || defined __USE_ISOC99
 /* Return X times (2 to the Nth power).  */
 /* Return X times (2 to the Nth power).  */
 __MATHCALL (scalbn,, (_Mdouble_ __x, int __n));
 __MATHCALL (scalbn,, (_Mdouble_ __x, int __n));
+# endif
 
 
 /* Return the binary exponent of X, which must be nonzero.  */
 /* Return the binary exponent of X, which must be nonzero.  */
 __MATHDECL (int,ilogb,, (_Mdouble_ __x));
 __MATHDECL (int,ilogb,, (_Mdouble_ __x));
 #endif
 #endif
 
 
-#ifdef __USE_ISOC9X
+#ifdef __USE_ISOC99
 /* Return X times (2 to the Nth power).  */
 /* Return X times (2 to the Nth power).  */
 __MATHCALL (scalbln,, (_Mdouble_ __x, long int __n));
 __MATHCALL (scalbln,, (_Mdouble_ __x, long int __n));
 
 
@@ -333,4 +330,4 @@ __MATHDECL_1 (int, __signbit,, (_Mdouble_ __value))
 
 
 /* Multiply-add function computed as a ternary operation.  */
 /* Multiply-add function computed as a ternary operation.  */
 __MATHCALL (fma,, (_Mdouble_ __x, _Mdouble_ __y, _Mdouble_ __z));
 __MATHCALL (fma,, (_Mdouble_ __x, _Mdouble_ __y, _Mdouble_ __z));
-#endif /* Use ISO C 9X.  */
+#endif /* Use ISO C99.  */

+ 12 - 24
libc/sysdeps/linux/sparc/bits/mathdef.h

@@ -1,20 +1,20 @@
-/* Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #if !defined _MATH_H && !defined _COMPLEX_H
 #if !defined _MATH_H && !defined _COMPLEX_H
 # error "Never use <bits/mathdef.h> directly; include <math.h> instead"
 # error "Never use <bits/mathdef.h> directly; include <math.h> instead"
@@ -25,7 +25,7 @@
 /* FIXME! This file describes properties of the compiler, not the machine;
 /* FIXME! This file describes properties of the compiler, not the machine;
    it should not be part of libc!  */
    it should not be part of libc!  */
 
 
-#if defined __USE_ISOC9X && defined _MATH_H && !defined _MATH_H_MATHDEF
+#if defined __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF
 # define _MATH_H_MATHDEF	1
 # define _MATH_H_MATHDEF	1
 
 
 # ifdef __GNUC__
 # ifdef __GNUC__
@@ -35,9 +35,6 @@
 typedef float float_t;
 typedef float float_t;
 typedef double double_t;
 typedef double double_t;
 
 
-/* Signal that types stay as they were declared.  */
-#   define FLT_EVAL_METHOD	0
-
 /* Define `INFINITY' as value of type `float'.  */
 /* Define `INFINITY' as value of type `float'.  */
 #   define INFINITY	HUGE_VALF
 #   define INFINITY	HUGE_VALF
 
 
@@ -47,9 +44,6 @@ typedef double double_t;
 typedef double float_t;
 typedef double float_t;
 typedef double double_t;
 typedef double double_t;
 
 
-/* Signal that both types are `double'.  */
-#   define FLT_EVAL_METHOD	1
-
 /* Define `INFINITY' as value of type `float'.  */
 /* Define `INFINITY' as value of type `float'.  */
 #   define INFINITY	HUGE_VALF
 #   define INFINITY	HUGE_VALF
 
 
@@ -60,20 +54,14 @@ typedef double double_t;
 typedef double float_t;
 typedef double float_t;
 typedef double double_t;
 typedef double double_t;
 
 
-/* Strange compiler, we don't know how it works.  */
-#  define FLT_EVAL_METHOD	-1
-
 /* Define `INFINITY' as value of type `float'.  */
 /* Define `INFINITY' as value of type `float'.  */
 #  define INFINITY	HUGE_VALF
 #  define INFINITY	HUGE_VALF
 
 
 # endif
 # endif
 
 
 /* The values returned by `ilogb' for 0 and NaN respectively.  */
 /* The values returned by `ilogb' for 0 and NaN respectively.  */
-# define FP_ILOGB0       0x80000001
+# define FP_ILOGB0       (-2147483647)
-# define FP_ILOGBNAN     0x7fffffff
+# define FP_ILOGBNAN     (2147483647)
-
-/* Number of decimal digits for the `double' type.  */
-# define DECIMAL_DIG	15
 
 
 #endif	/* ISO C99 */
 #endif	/* ISO C99 */
 
 

+ 222 - 6
libc/sysdeps/linux/sparc/bits/mathinline.h

@@ -1,12 +1,228 @@
-/* This file should provide inline versions of math functions.
+/* Inline math functions for SPARC.
+   Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Jakub Jelinek <jakub@redhat.com>.
 
 
-   Surround GCC-specific parts with #ifdef __GNUC__, and use `extern __inline'.
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
 
-   This file should define __MATH_INLINES if functions are actually defined as
+   The GNU C Library is distributed in the hope that it will be useful,
-   inlines.  */
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
 
 
-#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 
-/* Here goes the real code.  */
+#ifndef _MATH_H
+# error "Never use <bits/mathinline.h> directly; include <math.h> instead."
+#endif
+
+#include <bits/wordsize.h>
+
+#if defined __GNUC__
+
+#ifdef __USE_ISOC99
+
+#if __WORDSIZE == 32
+
+# define __unordered_cmp(x, y) \
+  (__extension__							      \
+   ({ unsigned __r;							      \
+      if (sizeof(x) == 4 && sizeof(y) == 4)				      \
+	{								      \
+	  float __x = (x); float __y = (y);				      \
+	  __asm__("fcmps %1,%2; st %%fsr, %0" : "=m" (__r) : "f" (__x),	      \
+		  "f" (__y) : "cc");					      \
+	}								      \
+      else								      \
+	{								      \
+	  double __x = (x); double __y = (y);				      \
+	  __asm__("fcmpd\t%1,%2\n\tst\t%%fsr,%0" : "=m" (__r) : "f" (__x),    \
+		  "f" (__y) : "cc");					      \
+	}								      \
+      __r; }))
+
+# define isgreater(x, y) ((__unordered_cmp (x, y) & (3 << 10)) == (2 << 10))
+# define isgreaterequal(x, y) ((__unordered_cmp (x, y) & (1 << 10)) == 0)
+# define isless(x, y) ((__unordered_cmp (x, y) & (3 << 10)) == (1 << 10))
+# define islessequal(x, y) ((__unordered_cmp (x, y) & (2 << 10)) == 0)
+# define islessgreater(x, y) (((__unordered_cmp (x, y) + (1 << 10)) & (2 << 10)) != 0)
+# define isunordered(x, y) ((__unordered_cmp (x, y) & (3 << 10)) == (3 << 10))
+
+#else /* sparc64 */
+
+# define __unordered_v9cmp(x, y, op, qop) \
+  (__extension__							      \
+   ({ unsigned __r;						      	      \
+      if (sizeof(x) == 4 && sizeof(y) == 4)				      \
+	{								      \
+	  float __x = (x); float __y = (y);				      \
+	  __asm__("fcmps\t%%fcc3,%1,%2\n\tmov" op "\t%%fcc3,1,%0"	      \
+		  : "=r" (__r) : "f" (__x), "f" (__y), "0" (0) : "cc");	      \
+	}								      \
+      else if (sizeof(x) <= 8 && sizeof(y) <= 8)			      \
+	{								      \
+	  double __x = (x); double __y = (y);				      \
+	  __asm__("fcmpd\t%%fcc3,%1,%2\n\tmov" op "\t%%fcc3,1,%0"	      \
+		  : "=r" (__r) : "f" (__x), "f" (__y), "0" (0) : "cc");	      \
+	}								      \
+      else								      \
+	{								      \
+	  long double __x = (x); long double __y = (y);			      \
+	  extern int _Qp_cmp(const long double *a, const long double *b);     \
+	  __r = qop;						      	      \
+	}								      \
+      __r; }))
+
+# define isgreater(x, y) __unordered_v9cmp(x, y, "g", _Qp_cmp (&__x, &__y) == 2)
+# define isgreaterequal(x, y) __unordered_v9cmp(x, y, "ge", (_Qp_cmp (&__x, &__y) & 1) == 0)
+# define isless(x, y) __unordered_v9cmp(x, y, "l", _Qp_cmp (&__x, &__y) == 1)
+# define islessequal(x, y) __unordered_v9cmp(x, y, "le", (_Qp_cmp (&__x, &__y) & 2) == 0)
+# define islessgreater(x, y) __unordered_v9cmp(x, y, "lg", ((_Qp_cmp (&__x, &__y) + 1) & 2) != 0)
+# define isunordered(x, y) __unordered_v9cmp(x, y, "u", _Qp_cmp (&__x, &__y) == 3)
+
+#endif /* sparc64 */
+
+#endif /* __USE_ISOC99 */
+
+#if (!defined __NO_MATH_INLINES || defined __LIBC_INTERNAL_MATH_INLINES) && defined __OPTIMIZE__
+
+#ifdef __cplusplus
+# define __MATH_INLINE __inline
+#else
+# define __MATH_INLINE extern __inline
+#endif  /* __cplusplus */
+
+/* The gcc, version 2.7 or below, has problems with all this inlining
+   code.  So disable it for this version of the compiler.  */
+# if __GNUC_PREREQ (2, 8)
+   /* Test for negative number.  Used in the signbit() macro.  */
+__MATH_INLINE int
+__signbitf (float __x) __THROW
+{
+  __extension__ union { float __f; int __i; } __u = { __f: __x };
+  return __u.__i < 0;
+}
+
+#if __WORDSIZE == 32
+
+__MATH_INLINE int
+__signbit (double __x) __THROW
+{
+  __extension__ union { double __d; int __i[2]; } __u = { __d: __x };
+  return __u.__i[0] < 0;
+}
+
+__MATH_INLINE int
+__signbitl (long double __x) __THROW
+{
+  return __signbit ((double)__x);
+}
+
+#else /* sparc64 */
+
+__MATH_INLINE int
+__signbit (double __x) __THROW
+{
+  __extension__ union { double __d; long __i; } __u = { __d: __x };
+  return __u.__i < 0;
+}
+
+__MATH_INLINE int
+__signbitl (long double __x) __THROW
+{
+  __extension__ union { long double __l; long __i[2]; } __u = { __l: __x };
+  return __u.__i[0] < 0;
+}
+
+#endif /* sparc64 */
+
+#ifndef __NO_MATH_INLINES
+
+__MATH_INLINE double
+sqrt(double __x) __THROW
+{
+  register double __r;
+  __asm ("fsqrtd %1,%0" : "=f" (__r) : "f" (__x));
+  return __r;
+}
+
+__MATH_INLINE float
+sqrtf(float __x) __THROW
+{
+  register float __r;
+  __asm ("fsqrts %1,%0" : "=f" (__r) : "f" (__x));
+  return __r;
+}
+
+#if __WORDSIZE == 64
+__MATH_INLINE long double
+sqrtl(long double __x) __THROW
+{
+  long double __r;
+  extern void _Qp_sqrt(long double *, __const__ long double *);
+  _Qp_sqrt(&__r, &__x);
+  return __r;
+}
+#endif /* sparc64 */
 
 
 #endif
 #endif
+
+/* This code is used internally in the GNU libc.  */
+#ifdef __LIBC_INTERNAL_MATH_INLINES
+__MATH_INLINE double
+__ieee754_sqrt(double __x)
+{
+  register double __r;
+  __asm ("fsqrtd %1,%0" : "=f" (__r) : "f" (__x));
+  return __r;
+}
+
+__MATH_INLINE float
+__ieee754_sqrtf(float __x)
+{
+  register float __r;
+  __asm ("fsqrts %1,%0" : "=f" (__r) : "f" (__x));
+  return __r;
+}
+
+#if __WORDSIZE == 64
+__MATH_INLINE long double
+__ieee754_sqrtl(long double __x)
+{
+  long double __r;
+  extern void _Qp_sqrt(long double *, __const__ long double *);
+  _Qp_sqrt(&__r, &__x);
+  return __r;
+}
+#endif /* sparc64 */
+#endif /* __LIBC_INTERNAL_MATH_INLINES */
+#endif /* gcc 2.8+ */
+
+#ifdef __USE_ISOC99
+
+#ifndef __NO_MATH_INLINES
+
+__MATH_INLINE double fdim (double __x, double __y);
+__MATH_INLINE double
+fdim (double __x, double __y)
+{
+  return __x < __y ? 0 : __x - __y;
+}
+
+__MATH_INLINE float fdimf (float __x, float __y);
+__MATH_INLINE float
+fdimf (float __x, float __y)
+{
+  return __x < __y ? 0 : __x - __y;
+}
+
+#endif /* !__NO_MATH_INLINES */
+#endif /* __USE_ISOC99 */
+#endif /* !__NO_MATH_INLINES && __OPTIMIZE__ */
+#endif /* __GNUC__ */

+ 27 - 9
libc/sysdeps/linux/sparc/bits/mman.h

@@ -1,21 +1,21 @@
 /* Definitions for POSIX memory map interface.  Linux/SPARC version.
 /* Definitions for POSIX memory map interface.  Linux/SPARC version.
-   Copyright (C) 1997, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #ifndef _SYS_MMAN_H
 #ifndef _SYS_MMAN_H
 # error "Never use <bits/mman.h> directly; include <sys/mman.h> instead."
 # error "Never use <bits/mman.h> directly; include <sys/mman.h> instead."
@@ -75,3 +75,21 @@
 #ifdef __USE_GNU
 #ifdef __USE_GNU
 # define MREMAP_MAYMOVE	1
 # define MREMAP_MAYMOVE	1
 #endif
 #endif
+
+/* Advice to `madvise'.  */
+#ifdef __USE_BSD
+# define MADV_NORMAL	 0	/* No further special treatment.  */
+# define MADV_RANDOM	 1	/* Expect random page references.  */
+# define MADV_SEQUENTIAL 2	/* Expect sequential page references.  */
+# define MADV_WILLNEED	 3	/* Will need these pages.  */
+# define MADV_DONTNEED	 4	/* Don't need these pages.  */
+#endif
+
+/* The POSIX people had to invent similar names for the same things.  */
+#ifdef __USE_XOPEN2K
+# define POSIX_MADV_NORMAL	0 /* No further special treatment.  */
+# define POSIX_MADV_RANDOM	1 /* Expect random page references.  */
+# define POSIX_MADV_SEQUENTIAL	2 /* Expect sequential page references.  */
+# define POSIX_MADV_WILLNEED	3 /* Will need these pages.  */
+# define POSIX_MADV_DONTNEED	4 /* Don't need these pages.  */
+#endif

+ 34 - 20
libc/sysdeps/linux/sparc/bits/msq.h

@@ -1,30 +1,37 @@
-/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996, 1997, 2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #ifndef _SYS_MSG_H
 #ifndef _SYS_MSG_H
 # error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."
 # error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."
 #endif
 #endif
 
 
-#include <sys/types.h>
+#include <bits/types.h>
+#include <bits/wordsize.h>
 
 
 /* Define options for message queue functions.  */
 /* Define options for message queue functions.  */
 #define MSG_NOERROR	010000	/* no error if message is too big */
 #define MSG_NOERROR	010000	/* no error if message is too big */
-#define MSG_EXCEPT	020000	/* recv any msg except of specified type */
+#ifdef __USE_GNU
+# define MSG_EXCEPT	020000	/* recv any msg except of specified type */
+#endif
+
+/* Types used in the structure definition.  */
+typedef unsigned long int msgqnum_t;
+typedef unsigned long int msglen_t;
 
 
 
 
 /* Structure of record for one message inside the kernel.
 /* Structure of record for one message inside the kernel.
@@ -32,18 +39,25 @@
 struct msqid_ds
 struct msqid_ds
 {
 {
   struct ipc_perm msg_perm;	/* structure describing operation permission */
   struct ipc_perm msg_perm;	/* structure describing operation permission */
-  struct msg *__msg_first;	/* pointer to first message on queue */
+#if __WORDSIZE == 32
-  struct msg *__msg_last;	/* pointer to last message on queue */
+  unsigned int __pad1;
+#endif
   __time_t msg_stime;		/* time of last msgsnd command */
   __time_t msg_stime;		/* time of last msgsnd command */
+#if __WORDSIZE == 32
+  unsigned int __pad2;
+#endif
   __time_t msg_rtime;		/* time of last msgrcv command */
   __time_t msg_rtime;		/* time of last msgrcv command */
+#if __WORDSIZE == 32
+  unsigned int __pad3;
+#endif
   __time_t msg_ctime;		/* time of last change */
   __time_t msg_ctime;		/* time of last change */
-  struct wait_queue *__wwait;	/* ??? */
+  unsigned long int __msg_cbytes; /* current number of bytes on queue */
-  struct wait_queue *__rwait;	/* ??? */
+  msgqnum_t msg_qnum;		/* number of messages currently on queue */
-  unsigned short int __msg_cbytes;/* current number of bytes on queue */
+  msglen_t msg_qbytes;		/* max number of bytes allowed on queue */
-  unsigned short int msg_qnum;	/* number of messages currently on queue */
+  __pid_t msg_lspid;		/* pid of last msgsnd() */
-  unsigned short int msg_qbytes;/* max number of bytes allowed on queue */
+  __pid_t msg_lrpid;		/* pid of last msgrcv() */
-  __ipc_pid_t msg_lspid;	/* pid of last msgsnd() */
+  unsigned long int __unused1;
-  __ipc_pid_t msg_lrpid;	/* pid of last msgrcv() */
+  unsigned long int __unused2;
 };
 };
 
 
 #ifdef __USE_MISC
 #ifdef __USE_MISC

+ 8 - 8
libc/sysdeps/linux/sparc/bits/nan.h

@@ -3,19 +3,19 @@
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #ifndef _MATH_H
 #ifndef _MATH_H
 # error "Never use <bits/nan.h> directly; include <math.h> instead."
 # error "Never use <bits/nan.h> directly; include <math.h> instead."

+ 9 - 12
libc/sysdeps/linux/sparc/bits/poll.h

@@ -1,20 +1,20 @@
-/* Copyright (C) 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #ifndef _SYS_POLL_H
 #ifndef _SYS_POLL_H
 # error "Never use <bits/poll.h> directly; include <sys/poll.h> instead."
 # error "Never use <bits/poll.h> directly; include <sys/poll.h> instead."
@@ -41,6 +41,3 @@
 #define POLLERR		0x008		/* Error condition.  */
 #define POLLERR		0x008		/* Error condition.  */
 #define POLLHUP		0x010		/* Hung up.  */
 #define POLLHUP		0x010		/* Hung up.  */
 #define POLLNVAL	0x020		/* Invalid polling request.  */
 #define POLLNVAL	0x020		/* Invalid polling request.  */
-
-/* Canonical number of polling requests to read in at a time in poll.  */
-#define NPOLLFILE	30

+ 11 - 11
libc/sysdeps/linux/sparc/bits/posix1_lim.h

@@ -1,20 +1,20 @@
-/* Copyright (C) 1991, 1992, 1993, 1996, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1991,92,93,96,98,2000,2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 /*
 /*
  *	POSIX Standard: 2.9.2 Minimum Values	Added to <limits.h>
  *	POSIX Standard: 2.9.2 Minimum Values	Added to <limits.h>
@@ -73,7 +73,7 @@
 #define	_POSIX_NAME_MAX		14
 #define	_POSIX_NAME_MAX		14
 
 
 /* Number of bytes in a pathname.  */
 /* Number of bytes in a pathname.  */
-#define	_POSIX_PATH_MAX		255
+#define	_POSIX_PATH_MAX		256
 
 
 /* Number of bytes than can be written atomically to a pipe.  */
 /* Number of bytes than can be written atomically to a pipe.  */
 #define	_POSIX_PIPE_BUF		512
 #define	_POSIX_PIPE_BUF		512
@@ -97,7 +97,7 @@
 #define	_POSIX_STREAM_MAX	8
 #define	_POSIX_STREAM_MAX	8
 
 
 /* Maximum length of a timezone name (element of `tzname').  */
 /* Maximum length of a timezone name (element of `tzname').  */
-#define	_POSIX_TZNAME_MAX	3
+#define	_POSIX_TZNAME_MAX	6
 
 
 /* Maximum number of connections that can be queued on a socket.  */
 /* Maximum number of connections that can be queued on a socket.  */
 #define	_POSIX_QLIMIT		1
 #define	_POSIX_QLIMIT		1

+ 14 - 23
libc/sysdeps/linux/sparc/bits/posix2_lim.h

@@ -1,20 +1,20 @@
-/* Copyright (C) 1991, 1996, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1996, 1999, 2000, 2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 /*
 /*
  * Never include this file directly; include <limits.h> instead.
  * Never include this file directly; include <limits.h> instead.
@@ -37,14 +37,8 @@
 #define	_POSIX2_BC_STRING_MAX		1000
 #define	_POSIX2_BC_STRING_MAX		1000
 
 
 /* The maximum number of weights that can be assigned to an entry of
 /* The maximum number of weights that can be assigned to an entry of
-   the LC_COLLATE `order' keyword in the locale definition file.
+   the LC_COLLATE `order' keyword in the locale definition file.  */
-   We have no fixed limit, 255 is very high.  */
+#define	_POSIX2_COLL_WEIGHTS_MAX	2
-#define	_POSIX2_COLL_WEIGHTS_MAX	255
-
-/* The maximum number of weights that can be assigned to an entry of
-   the LC_COLLATE category `order' keyword in a locale definition.
-   We have no fixed limit, 255 is a high number.  */
-#define	_POSIX2_EQUIV_CLASS_MAX		255
 
 
 /* The maximum number of expressions that can be nested
 /* The maximum number of expressions that can be nested
    within parentheses by the `expr' utility.  */
    within parentheses by the `expr' utility.  */
@@ -59,7 +53,7 @@
 
 
 /* The maximum number of bytes in a character class name.  We have no
 /* The maximum number of bytes in a character class name.  We have no
    fixed limit, 2048 is a high number.  */
    fixed limit, 2048 is a high number.  */
-#define	_POSIX2_CHARCLASS_NAME_MAX	2048
+#define	_POSIX2_CHARCLASS_NAME_MAX	14
 
 
 
 
 /* These values are implementation-specific,
 /* These values are implementation-specific,
@@ -79,10 +73,7 @@
 #define	BC_STRING_MAX		_POSIX2_BC_STRING_MAX
 #define	BC_STRING_MAX		_POSIX2_BC_STRING_MAX
 #endif
 #endif
 #ifndef	COLL_WEIGHTS_MAX
 #ifndef	COLL_WEIGHTS_MAX
-#define	COLL_WEIGHTS_MAX	_POSIX2_COLL_WEIGHTS_MAX
+#define	COLL_WEIGHTS_MAX	255
-#endif
-#ifndef	EQUIV_CLASS_MAX
-#define	EQUIV_CLASS_MAX		_POSIX2_EQUIV_CLASS_MAX
 #endif
 #endif
 #ifndef	EXPR_NEST_MAX
 #ifndef	EXPR_NEST_MAX
 #define	EXPR_NEST_MAX		_POSIX2_EXPR_NEST_MAX
 #define	EXPR_NEST_MAX		_POSIX2_EXPR_NEST_MAX
@@ -91,7 +82,7 @@
 #define	LINE_MAX		_POSIX2_LINE_MAX
 #define	LINE_MAX		_POSIX2_LINE_MAX
 #endif
 #endif
 #ifndef	CHARCLASS_NAME_MAX
 #ifndef	CHARCLASS_NAME_MAX
-#define	CHARCLASS_NAME_MAX	_POSIX2_CHARCLASS_NAME_MAX
+#define	CHARCLASS_NAME_MAX	2048
 #endif
 #endif
 
 
 /* This value is defined like this in regex.h.  */
 /* This value is defined like this in regex.h.  */

+ 33 - 2
libc/sysdeps/linux/sparc/bits/posix_opt.h

@@ -1,5 +1,5 @@
 /* Define POSIX options for Linux.
 /* Define POSIX options for Linux.
-   Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
@@ -89,13 +89,14 @@
 #define _POSIX_THREAD_ATTR_STACKADDR	1
 #define _POSIX_THREAD_ATTR_STACKADDR	1
 
 
 /* We support POSIX.1b semaphores, but only the non-shared form for now.  */
 /* We support POSIX.1b semaphores, but only the non-shared form for now.  */
-/*#define _POSIX_SEMAPHORES	1	XXX We are not quite there now.  */
+#define _POSIX_SEMAPHORES	1
 
 
 /* Real-time signals are supported.  */
 /* Real-time signals are supported.  */
 #define _POSIX_REALTIME_SIGNALS	1
 #define _POSIX_REALTIME_SIGNALS	1
 
 
 /* We support asynchronous I/O.  */
 /* We support asynchronous I/O.  */
 #define _POSIX_ASYNCHRONOUS_IO	1
 #define _POSIX_ASYNCHRONOUS_IO	1
+#define _POSIX_ASYNC_IO		1
 /* Alternative name for Unix98.  */
 /* Alternative name for Unix98.  */
 #define _LFS_ASYNCHRONOUS_IO	1
 #define _LFS_ASYNCHRONOUS_IO	1
 
 
@@ -107,4 +108,34 @@
 #define _LFS64_LARGEFILE	1
 #define _LFS64_LARGEFILE	1
 #define _LFS64_STDIO		1
 #define _LFS64_STDIO		1
 
 
+/* POSIX shared memory objects are implemented.  */
+#define _POSIX_SHARED_MEMORY_OBJECTS	1
+
+/* GNU libc provides regular expression handling.  */
+#define _POSIX_REGEXP	1
+
+/* Reader/Writer locks are available.  */
+#define _POSIX_READER_WRITER_LOCKS	200912L
+
+/* We have a POSIX shell.  */
+#define _POSIX_SHELL	1
+
+/* We support the Timeouts option.  */
+#define _POSIX_TIMEOUTS	200912L
+
+/* We support spinlocks.  */
+#define _POSIX_SPIN_LOCKS	200912L
+
+/* The `spawn' function family is supported.  */
+#define _POSIX_SPAWN	200912L
+
+/* We have POSIX timers.  */
+#define _POSIX_TIMERS	1
+
+/* The barrier functions are available.  */
+#define _POSIX_BARRIERS	200912L
+
+/* POSIX message queues are not yet supported.  */
+#undef	_POSIX_MESSAGE_PASSING
+
 #endif /* posix_opt.h */
 #endif /* posix_opt.h */

+ 23 - 3
libc/sysdeps/linux/sparc/bits/pthreadtypes.h

@@ -25,8 +25,9 @@
 /* Fast locks (not abstract because mutexes and conditions aren't abstract). */
 /* Fast locks (not abstract because mutexes and conditions aren't abstract). */
 struct _pthread_fastlock
 struct _pthread_fastlock
 {
 {
-  long int __status;            /* "Free" or "taken" or head of waiting list */
+  long int __status;   /* "Free" or "taken" or head of waiting list */
-  int __spinlock;               /* For compare-and-swap emulation */
+  int __spinlock;      /* Used by compare_and_swap emulation. Also,
+			  adaptive SMP lock stores spin count here. */
 };
 };
 
 
 #ifndef _PTHREAD_DESCR_DEFINED
 #ifndef _PTHREAD_DESCR_DEFINED
@@ -37,7 +38,7 @@ typedef struct _pthread_descr_struct *_pthread_descr;
 
 
 
 
 /* Attributes for threads.  */
 /* Attributes for threads.  */
-typedef struct
+typedef struct __pthread_attr_s
 {
 {
   int __detachstate;
   int __detachstate;
   int __schedpolicy;
   int __schedpolicy;
@@ -115,6 +116,25 @@ typedef struct
 } pthread_rwlockattr_t;
 } pthread_rwlockattr_t;
 #endif
 #endif
 
 
+#ifdef __USE_XOPEN2K
+/* POSIX spinlock data type.  */
+typedef volatile int pthread_spinlock_t;
+
+/* POSIX barrier. */
+typedef struct {
+  struct _pthread_fastlock __ba_lock; /* Lock to guarantee mutual exclusion */
+  int __ba_required;                  /* Threads needed for completion */
+  int __ba_present;                   /* Threads waiting */
+  _pthread_descr __ba_waiting;        /* Queue of waiting threads */
+} pthread_barrier_t;
+
+/* barrier attribute */
+typedef struct {
+  int __pshared;
+} pthread_barrierattr_t;
+
+#endif
+
 
 
 /* Thread identifiers */
 /* Thread identifiers */
 typedef unsigned long int pthread_t;
 typedef unsigned long int pthread_t;

+ 15 - 11
libc/sysdeps/linux/sparc/bits/resource.h

@@ -1,21 +1,21 @@
-/* Bit values & structures for resource limits.  SPARC/Linux version.
+/* Bit values & structures for resource limits.  Linux/SPARC version.
-   Copyright (C) 1994, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1994,1996,1997,1998,1999,2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #ifndef _SYS_RESOURCE_H
 #ifndef _SYS_RESOURCE_H
 # error "Never use <bits/resource.h> directly; include <sys/resource.h> instead."
 # error "Never use <bits/resource.h> directly; include <sys/resource.h> instead."
@@ -76,7 +76,11 @@ enum __rlimit_resource
   RLIMIT_MEMLOCK = 8,
   RLIMIT_MEMLOCK = 8,
 #define RLIMIT_MEMLOCK RLIMIT_MEMLOCK
 #define RLIMIT_MEMLOCK RLIMIT_MEMLOCK
 
 
-  RLIM_NLIMITS = 10
+  /* Maximum number of file locks.  */
+  RLIMIT_LOCKS = 10,
+#define RLIMIT_LOCKS RLIMIT_LOCKS
+
+  RLIM_NLIMITS = 11
 #define RLIMIT_NLIMITS RLIMIT_NLIMITS
 #define RLIMIT_NLIMITS RLIMIT_NLIMITS
 #define RLIM_NLIMITS RLIM_NLIMITS
 #define RLIM_NLIMITS RLIM_NLIMITS
 };
 };

+ 13 - 13
libc/sysdeps/linux/sparc/bits/sched.h

@@ -1,22 +1,22 @@
 /* Definitions of constants and data structure for POSIX 1003.1b-1993
 /* Definitions of constants and data structure for POSIX 1003.1b-1993
    scheduling interface.
    scheduling interface.
-   Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 1998, 1999, 2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #ifndef __need_schedparam
 #ifndef __need_schedparam
 
 
@@ -46,15 +46,15 @@
 /* The official definition.  */
 /* The official definition.  */
 struct sched_param
 struct sched_param
   {
   {
-    int sched_priority;
+    int __sched_priority;
   };
   };
 
 
 __BEGIN_DECLS
 __BEGIN_DECLS
 
 
 /* Clone current process.  */
 /* Clone current process.  */
 #ifdef __USE_MISC
 #ifdef __USE_MISC
-extern int clone __P ((int (*__fn) (void *__arg), void *__child_stack,
+extern int clone (int (*__fn) (void *__arg), void *__child_stack,
-		       int __flags, void *__arg));
+		  int __flags, void *__arg) __THROW;
 #endif
 #endif
 
 
 __END_DECLS
 __END_DECLS
@@ -67,7 +67,7 @@ __END_DECLS
 /* Data structure to describe a process' schedulability.  */
 /* Data structure to describe a process' schedulability.  */
 struct __sched_param
 struct __sched_param
   {
   {
-    int sched_priority;
+    int __sched_priority;
   };
   };
 # undef __need_schedparam
 # undef __need_schedparam
 #endif
 #endif

+ 11 - 18
libc/sysdeps/linux/sparc/bits/select.h

@@ -1,40 +1,33 @@
-/* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #ifndef _SYS_SELECT_H
 #ifndef _SYS_SELECT_H
 # error "Never use <bits/select.h> directly; include <sys/select.h> instead."
 # error "Never use <bits/select.h> directly; include <sys/select.h> instead."
 #endif
 #endif
 
 
-/* For some reason, this wants to use the definitions from 
-	/include/asm/posix_types.h  So we have to undef some symbols : 
-*/
-#undef __FD_ZERO
-#undef __FD_SET
-#undef __FD_CLR
-#undef __FD_ISSET
 
 
 /* We don't use `memset' because this would require a prototype and
 /* We don't use `memset' because this would require a prototype and
    the array isn't too big.  */
    the array isn't too big.  */
 #define __FD_ZERO(s) \
 #define __FD_ZERO(s) \
   do {									      \
   do {									      \
     unsigned int __i;							      \
     unsigned int __i;							      \
-    __fd_set *__arr = (s);						      \
+    fd_set *__arr = (s);						      \
-    for (__i = 0; __i < sizeof (__fd_set) / sizeof (__fd_mask); ++__i)	      \
+    for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i)	      \
       __FDS_BITS (__arr)[__i] = 0;					      \
       __FDS_BITS (__arr)[__i] = 0;					      \
   } while (0)
   } while (0)
 #define __FD_SET(d, s)     (__FDS_BITS (s)[__FDELT(d)] |= __FDMASK(d))
 #define __FD_SET(d, s)     (__FDS_BITS (s)[__FDELT(d)] |= __FDMASK(d))

+ 19 - 15
libc/sysdeps/linux/sparc/bits/sem.h

@@ -1,26 +1,27 @@
-/* Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #ifndef _SYS_SEM_H
 #ifndef _SYS_SEM_H
 # error "Never include <bits/sem.h> directly; use <sys/sem.h> instead."
 # error "Never include <bits/sem.h> directly; use <sys/sem.h> instead."
 #endif
 #endif
 
 
 #include <sys/types.h>
 #include <sys/types.h>
+#include <bits/wordsize.h>
 
 
 /* Flags for `semop'.  */
 /* Flags for `semop'.  */
 #define SEM_UNDO	0x1000		/* undo the operation on exit */
 #define SEM_UNDO	0x1000		/* undo the operation on exit */
@@ -39,16 +40,19 @@
 struct semid_ds
 struct semid_ds
 {
 {
   struct ipc_perm sem_perm;		/* operation permission struct */
   struct ipc_perm sem_perm;		/* operation permission struct */
+#if __WORDSIZE == 32
+  unsigned int __pad1;
+#endif
   __time_t sem_otime;			/* last semop() time */
   __time_t sem_otime;			/* last semop() time */
+#if __WORDSIZE == 32
+  unsigned int __pad2;
+#endif
   __time_t sem_ctime;			/* last time changed by semctl() */
   __time_t sem_ctime;			/* last time changed by semctl() */
-  struct sem *__sembase;		/* ptr to first semaphore in array */
+  unsigned long int sem_nsems;		/* number of semaphores in set */
-  struct sem_queue *__sem_pending;	/* pending operations */
+  unsigned long int __unused1;
-  struct sem_queue *__sem_pending_last; /* last pending operation */
+  unsigned long int __unused2;
-  struct sem_undo *__undo;		/* ondo requests on this array */
-  unsigned short int sem_nsems;		/* number of semaphores in set */
 };
 };
 
 
-
 /* The user should define a union like the following to use it for arguments
 /* The user should define a union like the following to use it for arguments
    for `semctl'.
    for `semctl'.
 
 

+ 38 - 12
libc/sysdeps/linux/sparc/bits/setjmp.h

@@ -1,20 +1,20 @@
-/* Copyright (C) 1997,1999 Free Software Foundation, Inc.
+/* Copyright (C) 1997,1999,2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 
 
 #ifndef _SETJMP_H
 #ifndef _SETJMP_H
@@ -25,9 +25,35 @@
 
 
 #if __WORDSIZE == 64
 #if __WORDSIZE == 64
 
 
-#include <sys/ucontext.h>
+#ifndef _ASM
-
+typedef struct __sparc64_jmp_buf
-typedef ucontext_t __jmp_buf[1];
+  {
+    struct __sparc64_jmp_buf	*uc_link;
+    unsigned long		uc_flags;
+    unsigned long		uc_sigmask;
+    struct __sparc64_jmp_buf_mcontext
+      {
+	unsigned long		mc_gregs[19];
+	unsigned long		mc_fp;
+	unsigned long		mc_i7;
+	struct __sparc64_jmp_buf_fpu
+	  {
+	    union
+	      {
+		unsigned int	sregs[32];
+		unsigned long	dregs[32];
+		long double	qregs[16];
+	      }			mcfpu_fpregs;
+	    unsigned long	mcfpu_fprs;
+	    unsigned long	mcfpu_gsr;
+	    void		*mcfpu_fq;
+	    unsigned char	mcfpu_qcnt;
+	    unsigned char	mcfpu_qentsz;
+	    unsigned char	mcfpu_enab;
+	  }			mc_fpregs;
+      }				uc_mcontext;
+  } __jmp_buf[1];
+#endif
 
 
 /* Test if longjmp to JMPBUF would unwind the frame
 /* Test if longjmp to JMPBUF would unwind the frame
    containing a local variable at ADDRESS.  */
    containing a local variable at ADDRESS.  */

+ 38 - 22
libc/sysdeps/linux/sparc/bits/shm.h

@@ -1,26 +1,27 @@
-/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996, 1997, 2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #ifndef _SYS_SHM_H
 #ifndef _SYS_SHM_H
 # error "Never include <bits/shm.h> directly; use <sys/shm.h> instead."
 # error "Never include <bits/shm.h> directly; use <sys/shm.h> instead."
 #endif
 #endif
 
 
-#include <sys/types.h>
+#include <bits/types.h>
+#include <bits/wordsize.h>
 
 
 /* Permission flag for shmget.  */
 /* Permission flag for shmget.  */
 #define SHM_R		0400		/* or S_IRUGO from <linux/stat.h> */
 #define SHM_R		0400		/* or S_IRUGO from <linux/stat.h> */
@@ -36,20 +37,31 @@
 #define SHM_UNLOCK	12		/* unlock segment (root only) */
 #define SHM_UNLOCK	12		/* unlock segment (root only) */
 
 
 
 
+/* Type to count number of attaches.  */
+typedef unsigned long int shmatt_t;
+
 /* Data structure describing a set of semaphores.  */
 /* Data structure describing a set of semaphores.  */
 struct shmid_ds
 struct shmid_ds
   {
   {
     struct ipc_perm shm_perm;		/* operation permission struct */
     struct ipc_perm shm_perm;		/* operation permission struct */
-    int shm_segsz;			/* size of segment in bytes */
+#if __WORDSIZE == 32
+    unsigned int __pad1;
+#endif
     __time_t shm_atime;			/* time of last shmat() */
     __time_t shm_atime;			/* time of last shmat() */
+#if __WORDSIZE == 32
+    unsigned int __pad2;
+#endif
     __time_t shm_dtime;			/* time of last shmdt() */
     __time_t shm_dtime;			/* time of last shmdt() */
+#if __WORDSIZE == 32
+    unsigned int __pad3;
+#endif
     __time_t shm_ctime;			/* time of last change by shmctl() */
     __time_t shm_ctime;			/* time of last change by shmctl() */
-    __ipc_pid_t shm_cpid;		/* pid of creator */
+    size_t shm_segsz;			/* size of segment in bytes */
-    __ipc_pid_t shm_lpid;		/* pid of last shmop */
+    __pid_t shm_cpid;			/* pid of creator */
-    unsigned short int shm_nattch;	/* number of current attaches */
+    __pid_t shm_lpid;			/* pid of last shmop */
-    unsigned short int __shm_npages;	/* size of segment (pages) */
+    shmatt_t shm_nattch;		/* number of current attaches */
-    unsigned long int *__shm_pages;	/* array of ptrs to frames -> SHMMAX */
+    unsigned long int __unused1;
-    struct vm_area_struct *__attaches;	/* descriptors for attaches */
+    unsigned long int __unused2;
   };
   };
 
 
 #ifdef __USE_MISC
 #ifdef __USE_MISC
@@ -64,11 +76,15 @@ struct shmid_ds
 
 
 struct	shminfo
 struct	shminfo
   {
   {
-    int shmmax;
+    unsigned long shmmax;
-    int shmmin;
+    unsigned long shmmin;
-    int shmmni;
+    unsigned long shmmni;
-    int shmseg;
+    unsigned long shmseg;
-    int shmall;
+    unsigned long shmall;
+    unsigned long __unused1;
+    unsigned long __unused2;
+    unsigned long __unused3;
+    unsigned long __unused4;
   };
   };
 
 
 struct shm_info
 struct shm_info

+ 14 - 14
libc/sysdeps/linux/sparc/bits/sigaction.h

@@ -1,21 +1,21 @@
 /* The proper definitions for Linux/SPARC sigaction.
 /* The proper definitions for Linux/SPARC sigaction.
-   Copyright (C) 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #ifndef _SIGNAL_H
 #ifndef _SIGNAL_H
 # error "Never include <bits/sigaction.h> directly; use <signal.h> instead."
 # error "Never include <bits/sigaction.h> directly; use <signal.h> instead."
@@ -24,14 +24,14 @@
 /* Structure describing the action to be taken when a signal arrives.  */
 /* Structure describing the action to be taken when a signal arrives.  */
 struct sigaction
 struct sigaction
   {
   {
-    /* Signal handler.  */
+    /* Signal handler. */
 #ifdef __USE_POSIX199309
 #ifdef __USE_POSIX199309
     union
     union
       {
       {
 	/* Used if SA_SIGINFO is not set.  */
 	/* Used if SA_SIGINFO is not set.  */
 	__sighandler_t sa_handler;
 	__sighandler_t sa_handler;
 	/* Used if SA_SIGINFO is set.  */
 	/* Used if SA_SIGINFO is set.  */
-	void (*sa_sigaction) __PMT ((int, siginfo_t *, void *));
+	void (*sa_sigaction) (int, siginfo_t *, void *);
       }
       }
     __sigaction_handler;
     __sigaction_handler;
 # define sa_handler	__sigaction_handler.sa_handler
 # define sa_handler	__sigaction_handler.sa_handler
@@ -47,16 +47,16 @@ struct sigaction
     unsigned long sa_flags;
     unsigned long sa_flags;
 
 
     /* Not used by Linux/Sparc yet.  */
     /* Not used by Linux/Sparc yet.  */
-    void (*sa_restorer) __PMT ((void));
+    void (*sa_restorer) (void);
   };
   };
 
 
 
 
 /* Bits in `sa_flags'.  */
 /* Bits in `sa_flags'.  */
 #define	SA_NOCLDSTOP 0x00000008  /* Don't send SIGCHLD when children stop.  */
 #define	SA_NOCLDSTOP 0x00000008  /* Don't send SIGCHLD when children stop.  */
-#define SA_NOCLDWAIT 0x00000100	 /* Don't create zombie on child death.  */
+#define SA_NOCLDWAIT 0x00000100  /* Don't create zombie on child death.  */
 #define SA_SIGINFO   0x00000200  /* Invoke signal-catching function with
 #define SA_SIGINFO   0x00000200  /* Invoke signal-catching function with
 				    three arguments instead of one.  */
 				    three arguments instead of one.  */
-#ifdef __USE_MISC
+#if defined __USE_UNIX98 || defined __USE_MISC
 # define SA_ONSTACK   0x00000001 /* Use signal stack by using `sa_restorer'. */
 # define SA_ONSTACK   0x00000001 /* Use signal stack by using `sa_restorer'. */
 # define SA_RESTART   0x00000002 /* Restart syscall on signal return.  */
 # define SA_RESTART   0x00000002 /* Restart syscall on signal return.  */
 # define SA_INTERRUPT 0x00000010 /* Historical no-op.  */
 # define SA_INTERRUPT 0x00000010 /* Historical no-op.  */

+ 64 - 15
libc/sysdeps/linux/sparc/bits/sigcontext.h

@@ -1,29 +1,78 @@
-/* Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H
 #if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H
 # error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
 # error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
 #endif
 #endif
 
 
-#ifndef sigcontext_struct
+#include <bits/wordsize.h>
-/* Kernel headers before 2.1.1 define a struct sigcontext_struct, but
-   we need sigcontext.  */
-# define sigcontext_struct sigcontext
 
 
-# include <asm/sigcontext.h>
+#if __WORDSIZE == 32
-#endif
+
+/* It is quite hard to choose what to put here, because
+   Linux/sparc32 had at least 3 totally incompatible
+   signal stack layouts.
+   This one is for the "new" style signals, which are
+   now delivered unless SA_SIGINFO is requested.  */
+
+struct sigcontext
+  {
+    struct
+      {
+	unsigned int	psr;
+	unsigned int	pc;
+	unsigned int	npc;
+	unsigned int	y;
+	unsigned int	u_regs[16]; /* globals and ins */
+      }			si_regs;
+    int			si_mask;
+  };
+
+#else /* sparc64 */
+
+typedef struct
+  {
+    unsigned int	si_float_regs [64];
+    unsigned long	si_fsr;
+    unsigned long	si_gsr;
+    unsigned long	si_fprs;
+  } __siginfo_fpu_t;
+
+struct sigcontext
+  {
+    char		sigc_info[128];
+    struct
+      {
+	unsigned long	u_regs[16]; /* globals and ins */
+	unsigned long	tstate;
+	unsigned long	tpc;
+	unsigned long	tnpc;
+	unsigned int	y;
+	unsigned int	fprs;
+      }			sigc_regs;
+    __siginfo_fpu_t *	sigc_fpu_save;
+    struct
+      {
+	void *		ss_sp;
+	int		ss_flags;
+	unsigned long	ss_size;
+      }			sigc_stack;
+    unsigned long	sigc_mask;
+};
+
+#endif /* sparc64 */

+ 57 - 21
libc/sysdeps/linux/sparc/bits/siginfo.h

@@ -1,29 +1,33 @@
-/* siginfo_t, sigevent and constants.  Linux version.
+/* siginfo_t, sigevent and constants.  Linux/SPARC version.
-   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
-#if !defined _SIGNAL_H && !defined __need_siginfo_t
+#if !defined _SIGNAL_H && !defined __need_siginfo_t \
+    && !defined __need_sigevent_t
 # error "Never include this file directly.  Use <signal.h> instead"
 # error "Never include this file directly.  Use <signal.h> instead"
 #endif
 #endif
 
 
-#if (!defined __have_siginfo_t \
+#include <bits/wordsize.h>
-     && (defined _SIGNAL_H || defined __need_siginfo_t))
+
-# define __have_siginfo_t	1
+#if (!defined __have_sigval_t \
+     && (defined _SIGNAL_H || defined __need_siginfo_t \
+	 || defined __need_sigevent_t))
+# define __have_sigval_t	1
 
 
 /* Type for data associated with a signal.  */
 /* Type for data associated with a signal.  */
 typedef union sigval
 typedef union sigval
@@ -31,9 +35,18 @@ typedef union sigval
     int sival_int;
     int sival_int;
     void *sival_ptr;
     void *sival_ptr;
   } sigval_t;
   } sigval_t;
+#endif
+
+#if (!defined __have_siginfo_t \
+     && (defined _SIGNAL_H || defined __need_siginfo_t))
+# define __have_siginfo_t	1
 
 
 # define __SI_MAX_SIZE     128
 # define __SI_MAX_SIZE     128
-# define __SI_PAD_SIZE     ((__SI_MAX_SIZE / sizeof (int)) - 3)
+# if __WORDSIZE == 64
+#  define __SI_PAD_SIZE     ((__SI_MAX_SIZE / sizeof (int)) - 4)
+# else
+#  define __SI_PAD_SIZE     ((__SI_MAX_SIZE / sizeof (int)) - 3)
+# endif
 
 
 typedef struct siginfo
 typedef struct siginfo
   {
   {
@@ -82,6 +95,7 @@ typedef struct siginfo
 	struct
 	struct
 	  {
 	  {
 	    void *si_addr;	/* Faulting insn/memory ref.  */
 	    void *si_addr;	/* Faulting insn/memory ref.  */
+	    int si_trapno;
 	  } _sigfault;
 	  } _sigfault;
 
 
 	/* SIGPOLL.  */
 	/* SIGPOLL.  */
@@ -97,6 +111,8 @@ typedef struct siginfo
 /* X/Open requires some more fields with fixed names.  */
 /* X/Open requires some more fields with fixed names.  */
 # define si_pid		_sifields._kill.si_pid
 # define si_pid		_sifields._kill.si_pid
 # define si_uid		_sifields._kill.si_uid
 # define si_uid		_sifields._kill.si_uid
+# define si_timer1	_sifields._timer._timer1
+# define si_timer2	_sifields._timer._timer2
 # define si_status	_sifields._sigchld.si_status
 # define si_status	_sifields._sigchld.si_status
 # define si_utime	_sifields._sigchld.si_utime
 # define si_utime	_sifields._sigchld.si_utime
 # define si_stime	_sifields._sigchld.si_stime
 # define si_stime	_sifields._sigchld.si_stime
@@ -104,6 +120,7 @@ typedef struct siginfo
 # define si_int		_sifields._rt.si_sigval.sival_int
 # define si_int		_sifields._rt.si_sigval.sival_int
 # define si_ptr		_sifields._rt.si_sigval.sival_ptr
 # define si_ptr		_sifields._rt.si_sigval.sival_ptr
 # define si_addr	_sifields._sigfault.si_addr
 # define si_addr	_sifields._sigfault.si_addr
+# define si_trapno	_sifields._sigfault.si_trapno
 # define si_band	_sifields._sigpoll.si_band
 # define si_band	_sifields._sigpoll.si_band
 # define si_fd		_sifields._sigpoll.si_fd
 # define si_fd		_sifields._sigpoll.si_fd
 
 
@@ -112,7 +129,9 @@ typedef struct siginfo
    signals.  */
    signals.  */
 enum
 enum
 {
 {
-  SI_SIGIO = -5,		/* Sent by queued SIGIO. */
+  SI_ASYNCNL = -6,		/* Sent by asynch name lookup completion.  */
+# define SI_ASYNCNL	SI_ASYNCNL
+  SI_SIGIO,			/* Sent by queued SIGIO. */
 # define SI_SIGIO	SI_SIGIO
 # define SI_SIGIO	SI_SIGIO
   SI_ASYNCIO,			/* Sent by AIO completion.  */
   SI_ASYNCIO,			/* Sent by AIO completion.  */
 # define SI_ASYNCIO	SI_ASYNCIO
 # define SI_ASYNCIO	SI_ASYNCIO
@@ -122,8 +141,10 @@ enum
 # define SI_TIMER	SI_TIMER
 # define SI_TIMER	SI_TIMER
   SI_QUEUE,			/* Sent by sigqueue.  */
   SI_QUEUE,			/* Sent by sigqueue.  */
 # define SI_QUEUE	SI_QUEUE
 # define SI_QUEUE	SI_QUEUE
-  SI_USER			/* Sent by kill, sigsend, raise.  */
+  SI_USER,			/* Sent by kill, sigsend, raise.  */
 # define SI_USER	SI_USER
 # define SI_USER	SI_USER
+  SI_KERNEL = 0x80		/* Send by kernel.  */
+#define SI_KERNEL	SI_KERNEL
 };
 };
 
 
 
 
@@ -232,16 +253,31 @@ enum
 # define POLL_HUP	POLL_HUP
 # define POLL_HUP	POLL_HUP
 };
 };
 
 
+/* `si_code' values for SIGEMT signal.  */
+enum
+{
+  EMT_TAGOVF = 1		/* Tag overflow.  */
+# define EMT_TAGOVF	EMT_TAGOVF
+};
+
 # undef __need_siginfo_t
 # undef __need_siginfo_t
 #endif	/* !have siginfo_t && (have _SIGNAL_H || need siginfo_t).  */
 #endif	/* !have siginfo_t && (have _SIGNAL_H || need siginfo_t).  */
 
 
 
 
-#if defined _SIGNAL_H && !defined __have_sigevent_t
+#if (defined _SIGNAL_H || defined __need_sigevent_t) \
+    && !defined __have_sigevent_t
 # define __have_sigevent_t	1
 # define __have_sigevent_t	1
 
 
 /* Structure to transport application-defined values with signals.  */
 /* Structure to transport application-defined values with signals.  */
 # define __SIGEV_MAX_SIZE	64
 # define __SIGEV_MAX_SIZE	64
-# define __SIGEV_PAD_SIZE	((__SIGEV_MAX_SIZE / sizeof (int)) - 3)
+# if __WORDSIZE == 64
+#  define __SIGEV_PAD_SIZE	((__SIGEV_MAX_SIZE / sizeof (int)) - 4)
+# else
+#  define __SIGEV_PAD_SIZE	((__SIGEV_MAX_SIZE / sizeof (int)) - 3)
+# endif
+
+/* Forward declaration of the `pthread_attr_t' type.  */
+struct __pthread_attr_s;
 
 
 typedef struct sigevent
 typedef struct sigevent
   {
   {
@@ -255,8 +291,8 @@ typedef struct sigevent
 
 
 	struct
 	struct
 	  {
 	  {
-	    void (*_function) __PMT ((sigval_t)); /* Function to start.  */
+	    void (*_function) (sigval_t);	  /* Function to start.  */
-	    void *_attribute;			  /* Really pthread_attr_t.  */
+	    struct __pthread_attr_s *_attribute;  /* Really pthread_attr_t.  */
 	  } _sigev_thread;
 	  } _sigev_thread;
       } _sigev_un;
       } _sigev_un;
   } sigevent_t;
   } sigevent_t;

+ 9 - 9
libc/sysdeps/linux/sparc/bits/signum.h

@@ -3,19 +3,19 @@
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #ifdef	_SIGNAL_H
 #ifdef	_SIGNAL_H
 
 
@@ -55,7 +55,7 @@
 #define SIGTSTP		18
 #define SIGTSTP		18
 #define SIGCONT		19
 #define SIGCONT		19
 #define SIGCHLD		20
 #define SIGCHLD		20
-#define SIGCLD          SIGCHLD /* Same as SIGCHLD (System V).  */
+#define SIGCLD		SIGCHLD	/* Same as SIGCHLD (System V).  */
 #define SIGTTIN		21
 #define SIGTTIN		21
 #define SIGTTOU		22
 #define SIGTTOU		22
 #define SIGIO		23
 #define SIGIO		23

+ 8 - 11
libc/sysdeps/linux/sparc/bits/sigset.h

@@ -3,19 +3,19 @@
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #ifndef	_SIGSET_H_types
 #ifndef	_SIGSET_H_types
 # define _SIGSET_H_types	1
 # define _SIGSET_H_types	1
@@ -97,8 +97,6 @@ typedef struct
 #  endif
 #  endif
 # endif
 # endif
 
 
-__BEGIN_DECLS
-
 /* These functions needn't check for a bogus signal number -- error
 /* These functions needn't check for a bogus signal number -- error
    checking is done in the non __ versions.  */
    checking is done in the non __ versions.  */
 
 
@@ -123,6 +121,5 @@ __SIGSETFN (__sigdelset, ((__set->__val[__word] &= ~__mask), 0), )
 #  undef __SIGSETFN
 #  undef __SIGSETFN
 # endif
 # endif
 
 
-__END_DECLS
 
 
 #endif /* ! _SIGSET_H_fns.  */
 #endif /* ! _SIGSET_H_fns.  */

+ 11 - 11
libc/sysdeps/linux/sparc/bits/sigstack.h

@@ -1,21 +1,21 @@
 /* sigstack, sigaltstack definitions.
 /* sigstack, sigaltstack definitions.
-   Copyright (C) 1998 Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #ifndef _SIGNAL_H
 #ifndef _SIGNAL_H
 # error "Never include this file directly.  Use <signal.h> instead"
 # error "Never include this file directly.  Use <signal.h> instead"
@@ -25,7 +25,7 @@
 /* Structure describing a signal stack (obsolete).  */
 /* Structure describing a signal stack (obsolete).  */
 struct sigstack
 struct sigstack
   {
   {
-    __ptr_t ss_sp;		/* Signal stack pointer.  */
+    void *ss_sp;		/* Signal stack pointer.  */
     int ss_onstack;		/* Nonzero if executing on this stack.  */
     int ss_onstack;		/* Nonzero if executing on this stack.  */
   };
   };
 
 
@@ -49,7 +49,7 @@ enum
 /* Alternate, preferred interface.  */
 /* Alternate, preferred interface.  */
 typedef struct sigaltstack
 typedef struct sigaltstack
   {
   {
-    __ptr_t ss_sp;
+    void *ss_sp;
     int ss_flags;
     int ss_flags;
     size_t ss_size;
     size_t ss_size;
   } stack_t;
   } stack_t;

+ 6 - 9
libc/sysdeps/linux/sparc/bits/sigthread.h

@@ -1,5 +1,5 @@
 /* Signal handling function for threaded programs.
 /* Signal handling function for threaded programs.
-   Copyright (C) 1998 Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
@@ -17,25 +17,22 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
    Boston, MA 02111-1307, USA.  */
 
 
-#ifndef _BITS_SIGTHREAD_H 
+#ifndef _BITS_SIGTHREAD_H
 #define _BITS_SIGTHREAD_H	1
 #define _BITS_SIGTHREAD_H	1
 
 
 #if !defined _SIGNAL_H && !defined _PTHREAD_H
 #if !defined _SIGNAL_H && !defined _PTHREAD_H
 # error "Never include this file directly.  Use <pthread.h> instead"
 # error "Never include this file directly.  Use <pthread.h> instead"
 #endif
 #endif
 
 
-__BEGIN_DECLS
-
 /* Functions for handling signals. */
 /* Functions for handling signals. */
 
 
 /* Modify the signal mask for the calling thread.  The arguments have
 /* Modify the signal mask for the calling thread.  The arguments have
    the same meaning as for sigprocmask(2). */
    the same meaning as for sigprocmask(2). */
-extern int pthread_sigmask __P ((int __how, __const __sigset_t *__newmask,
+extern int pthread_sigmask (int __how,
-				 __sigset_t *__oldmask));
+			    __const __sigset_t *__restrict __newmask,
+			    __sigset_t *__restrict __oldmask)__THROW;
 
 
 /* Send signal SIGNO to the given thread. */
 /* Send signal SIGNO to the given thread. */
-extern int pthread_kill __P ((pthread_t __thread, int __signo));
+extern int pthread_kill (pthread_t __thread, int __signo) __THROW;
-
-__END_DECLS
 
 
 #endif	/* bits/sigthread.h */
 #endif	/* bits/sigthread.h */

+ 9 - 16
libc/sysdeps/linux/sparc/bits/sockaddr.h

@@ -1,21 +1,21 @@
 /* Definition of `struct sockaddr_*' common members.  Generic/4.2 BSD version.
 /* Definition of `struct sockaddr_*' common members.  Generic/4.2 BSD version.
-   Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1995,1996,1997,1998,2000,2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 /*
 /*
  * Never include this file directly; use <sys/socket.h> instead.
  * Never include this file directly; use <sys/socket.h> instead.
@@ -24,7 +24,6 @@
 #ifndef _BITS_SOCKADDR_H
 #ifndef _BITS_SOCKADDR_H
 #define _BITS_SOCKADDR_H	1
 #define _BITS_SOCKADDR_H	1
 
 
-__BEGIN_DECLS
 
 
 /* POSIX.1g specifies this type name for the `sa_family' member.  */
 /* POSIX.1g specifies this type name for the `sa_family' member.  */
 typedef unsigned short int sa_family_t;
 typedef unsigned short int sa_family_t;
@@ -38,10 +37,4 @@ typedef unsigned short int sa_family_t;
 
 
 #define __SOCKADDR_COMMON_SIZE	(sizeof (unsigned short int))
 #define __SOCKADDR_COMMON_SIZE	(sizeof (unsigned short int))
 
 
-/* Return the length of a `sockaddr' structure.  */
-#define SA_LEN(_x)	__libc_sa_len((_x)->sa_family)
-extern int __libc_sa_len __P ((sa_family_t __af));
-
-__END_DECLS
-
 #endif	/* bits/sockaddr.h */
 #endif	/* bits/sockaddr.h */

+ 45 - 29
libc/sysdeps/linux/sparc/bits/socket.h

@@ -1,21 +1,21 @@
-/* System-specific socket constants and types.  Linux version.
+/* System-specific socket constants and types.  Linux/SPARC version.
-   Copyright (C) 1991,92,94,95,96,97,98,99 Free Software Foundation, Inc.
+   Copyright (C) 1991,1992,1994-1999,2000,2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #ifndef __BITS_SOCKET_H
 #ifndef __BITS_SOCKET_H
 #define __BITS_SOCKET_H
 #define __BITS_SOCKET_H
@@ -32,7 +32,10 @@
 #include <sys/types.h>
 #include <sys/types.h>
 
 
 /* Type for length arguments in socket calls.  */
 /* Type for length arguments in socket calls.  */
-typedef unsigned int socklen_t;
+#ifndef __socklen_t_defined
+typedef __socklen_t socklen_t;
+# define __socklen_t_defined
+#endif
 
 
 /* Types of sockets.  */
 /* Types of sockets.  */
 enum __socket_type
 enum __socket_type
@@ -82,7 +85,10 @@ enum __socket_type
 #define	PF_ECONET	19	/* Acorn Econet.  */
 #define	PF_ECONET	19	/* Acorn Econet.  */
 #define	PF_ATMSVC	20	/* ATM SVCs.  */
 #define	PF_ATMSVC	20	/* ATM SVCs.  */
 #define	PF_SNA		22	/* Linux SNA Project */
 #define	PF_SNA		22	/* Linux SNA Project */
-#define PF_IRDA		23	/* IRDA sockets.  */
+#define	PF_IRDA		23	/* IRDA sockets.  */
+#define	PF_PPPOX	24	/* PPPoX sockets.  */
+#define	PF_WANPIPE	25	/* Wanpipe API sockets.  */
+#define	PF_BLUETOOTH	31	/* Bluetooth sockets.  */
 #define	PF_MAX		32	/* For now..  */
 #define	PF_MAX		32	/* For now..  */
 
 
 /* Address families.  */
 /* Address families.  */
@@ -111,7 +117,10 @@ enum __socket_type
 #define	AF_ECONET	PF_ECONET
 #define	AF_ECONET	PF_ECONET
 #define	AF_ATMSVC	PF_ATMSVC
 #define	AF_ATMSVC	PF_ATMSVC
 #define	AF_SNA		PF_SNA
 #define	AF_SNA		PF_SNA
-#define AF_IRDA		PF_IRDA
+#define	AF_IRDA		PF_IRDA
+#define	AF_PPPOX	PF_PPPOX
+#define	AF_WANPIPE	PF_WANPIPE
+#define	AF_BLUETOOTH	PF_BLUETOOTH
 #define	AF_MAX		PF_MAX
 #define	AF_MAX		PF_MAX
 
 
 /* Socket level values.  Others are defined in the appropriate headers.
 /* Socket level values.  Others are defined in the appropriate headers.
@@ -152,7 +161,7 @@ struct sockaddr
 
 
 struct sockaddr_storage
 struct sockaddr_storage
   {
   {
-    __SOCKADDR_COMMON (__ss_);	/* Address family, etc.  */
+    __SOCKADDR_COMMON (ss_);	/* Address family, etc.  */
     __ss_aligntype __ss_align;	/* Force desired alignment.  */
     __ss_aligntype __ss_align;	/* Force desired alignment.  */
     char __ss_padding[_SS_PADSIZE];
     char __ss_padding[_SS_PADSIZE];
   };
   };
@@ -188,14 +197,16 @@ enum
 #define	MSG_FIN		MSG_FIN
 #define	MSG_FIN		MSG_FIN
     MSG_SYN		= 0x400,
     MSG_SYN		= 0x400,
 #define	MSG_SYN		MSG_SYN
 #define	MSG_SYN		MSG_SYN
-    MSG_URG		= 0x800,
+    MSG_CONFIRM		= 0x800, /* Confirm path validity.  */
-#define	MSG_URG		MSG_URG
+#define	MSG_CONFIRM	MSG_CONFIRM
     MSG_RST		= 0x1000,
     MSG_RST		= 0x1000,
 #define	MSG_RST		MSG_RST
 #define	MSG_RST		MSG_RST
     MSG_ERRQUEUE	= 0x2000, /* Fetch message from error queue.  */
     MSG_ERRQUEUE	= 0x2000, /* Fetch message from error queue.  */
 #define	MSG_ERRQUEUE	MSG_ERRQUEUE
 #define	MSG_ERRQUEUE	MSG_ERRQUEUE
-    MSG_NOSIGNAL	= 0x4000  /* Do not generate SIGPIPE.  */
+    MSG_NOSIGNAL	= 0x4000, /* Do not generate SIGPIPE.  */
 #define	MSG_NOSIGNAL	MSG_NOSIGNAL
 #define	MSG_NOSIGNAL	MSG_NOSIGNAL
+    MSG_MORE		= 0x8000  /* Sender will send more.  */
+#define	MSG_MORE	MSG_MORE
   };
   };
 
 
 
 
@@ -203,15 +214,21 @@ enum
    `sendmsg' and received by `recvmsg'.  */
    `sendmsg' and received by `recvmsg'.  */
 struct msghdr
 struct msghdr
   {
   {
-    __ptr_t msg_name;		/* Address to send to/receive from.  */
+    void *msg_name;		/* Address to send to/receive from.  */
     socklen_t msg_namelen;	/* Length of address data.  */
     socklen_t msg_namelen;	/* Length of address data.  */
 
 
     struct iovec *msg_iov;	/* Vector of data to send/receive into.  */
     struct iovec *msg_iov;	/* Vector of data to send/receive into.  */
+#if __WORDSIZE == 32
+    int msg_iovlen;		/* Number of elements in the vector.  */
+
+    void *msg_control;		/* Ancillary data (eg BSD filedesc passing). */
+    socklen_t msg_controllen;	/* Ancillary data buffer length.  */
+#else
     size_t msg_iovlen;		/* Number of elements in the vector.  */
     size_t msg_iovlen;		/* Number of elements in the vector.  */
 
 
-    __ptr_t msg_control;	/* Ancillary data (eg BSD filedesc passing). */
+    void *msg_control;		/* Ancillary data (eg BSD filedesc passing). */
     size_t msg_controllen;	/* Ancillary data buffer length.  */
     size_t msg_controllen;	/* Ancillary data buffer length.  */
-
+#endif
     int msg_flags;		/* Flags on received message.  */
     int msg_flags;		/* Flags on received message.  */
   };
   };
 
 
@@ -222,14 +239,13 @@ struct cmsghdr
 				   of cmsghdr structure.  */
 				   of cmsghdr structure.  */
     int cmsg_level;		/* Originating protocol.  */
     int cmsg_level;		/* Originating protocol.  */
     int cmsg_type;		/* Protocol specific type.  */
     int cmsg_type;		/* Protocol specific type.  */
-#if !defined __STRICT_ANSI__ && defined __GNUC__ && __GNUC__ >= 2
+#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
-    unsigned char __cmsg_data[0]; /* Ancillary data.  */
+    __extension__ unsigned char __cmsg_data __flexarr; /* Ancillary data.  */
-    /* XXX Perhaps this should be removed.  */
 #endif
 #endif
   };
   };
 
 
 /* Ancillary data object manipulation macros.  */
 /* Ancillary data object manipulation macros.  */
-#if !defined __STRICT_ANSI__ && defined __GNUC__ && __GNUC__ >= 2
+#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
 # define CMSG_DATA(cmsg) ((cmsg)->__cmsg_data)
 # define CMSG_DATA(cmsg) ((cmsg)->__cmsg_data)
 #else
 #else
 # define CMSG_DATA(cmsg) ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1))
 # define CMSG_DATA(cmsg) ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1))
@@ -239,19 +255,19 @@ struct cmsghdr
   ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr)		      \
   ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr)		      \
    ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) NULL)
    ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) NULL)
 #define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) \
 #define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) \
-			 & ~(sizeof (size_t) - 1))
+			 & (size_t) ~(sizeof (size_t) - 1))
 #define CMSG_SPACE(len) (CMSG_ALIGN (len) \
 #define CMSG_SPACE(len) (CMSG_ALIGN (len) \
 			 + CMSG_ALIGN (sizeof (struct cmsghdr)))
 			 + CMSG_ALIGN (sizeof (struct cmsghdr)))
 #define CMSG_LEN(len)   (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
 #define CMSG_LEN(len)   (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
 
 
-extern struct cmsghdr *__cmsg_nxthdr __P ((struct msghdr *__mhdr,
+extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
-					   struct cmsghdr *__cmsg));
+				      struct cmsghdr *__cmsg) __THROW;
 #ifdef __USE_EXTERN_INLINES
 #ifdef __USE_EXTERN_INLINES
 # ifndef _EXTERN_INLINE
 # ifndef _EXTERN_INLINE
 #  define _EXTERN_INLINE extern __inline
 #  define _EXTERN_INLINE extern __inline
 # endif
 # endif
 _EXTERN_INLINE struct cmsghdr *
 _EXTERN_INLINE struct cmsghdr *
-__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg)
+__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg) __THROW
 {
 {
   if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
   if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
     /* The kernel header does this so there may be a reason.  */
     /* The kernel header does this so there may be a reason.  */
@@ -262,7 +278,7 @@ __cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg)
   if ((unsigned char *) (__cmsg + 1) >= ((unsigned char *) __mhdr->msg_control
   if ((unsigned char *) (__cmsg + 1) >= ((unsigned char *) __mhdr->msg_control
 					 + __mhdr->msg_controllen)
 					 + __mhdr->msg_controllen)
       || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
       || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
-	  >= ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
+	  > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
     /* No more entries.  */
     /* No more entries.  */
     return 0;
     return 0;
   return __cmsg;
   return __cmsg;

+ 8 - 8
libc/sysdeps/linux/sparc/bits/stab.def

@@ -3,19 +3,19 @@
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 /* This contains contribution from Cygnus Support.  */
 /* This contains contribution from Cygnus Support.  */
 
 

+ 20 - 15
libc/sysdeps/linux/sparc/bits/stat.h

@@ -1,20 +1,20 @@
-/* Copyright (C) 1992, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1992,95,96,97,98,99,2000,2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #ifndef _SYS_STAT_H
 #ifndef _SYS_STAT_H
 # error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
 # error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
@@ -36,8 +36,8 @@
 struct stat
 struct stat
   {
   {
     __dev_t st_dev;			/* Device.  */
     __dev_t st_dev;			/* Device.  */
+#if __WORDSIZE == 64 || !defined __USE_FILE_OFFSET64
     unsigned short int __pad1;
     unsigned short int __pad1;
-#ifndef __USE_FILE_OFFSET64
     __ino_t st_ino;			/* File serial number.	*/
     __ino_t st_ino;			/* File serial number.	*/
 #else
 #else
     __ino64_t st_ino;			/* File serial number.	*/
     __ino64_t st_ino;			/* File serial number.	*/
@@ -53,7 +53,7 @@ struct stat
 #else
 #else
     __off64_t st_size;			/* Size of file, in bytes.  */
     __off64_t st_size;			/* Size of file, in bytes.  */
 #endif
 #endif
-    unsigned long int st_blksize;	/* Optimal block size for I/O.  */
+    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
 
 
 #ifndef __USE_FILE_OFFSET64
 #ifndef __USE_FILE_OFFSET64
     __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */
     __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */
@@ -74,8 +74,9 @@ struct stat
 struct stat64
 struct stat64
   {
   {
     __dev_t st_dev;			/* Device.  */
     __dev_t st_dev;			/* Device.  */
+#if __WORDSIZE == 64
     unsigned short int __pad1;
     unsigned short int __pad1;
-
+#endif
     __ino64_t st_ino;			/* File serial number.	*/
     __ino64_t st_ino;			/* File serial number.	*/
     __mode_t st_mode;			/* File mode.  */
     __mode_t st_mode;			/* File mode.  */
     __nlink_t st_nlink;			/* Link count.  */
     __nlink_t st_nlink;			/* Link count.  */
@@ -84,7 +85,7 @@ struct stat64
     __dev_t st_rdev;			/* Device number, if device.  */
     __dev_t st_rdev;			/* Device number, if device.  */
     unsigned short int __pad2;
     unsigned short int __pad2;
     __off64_t st_size;			/* Size of file, in bytes.  */
     __off64_t st_size;			/* Size of file, in bytes.  */
-    unsigned long int st_blksize;	/* Optimal block size for I/O.  */
+    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
 
 
     __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
     __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
     __time_t st_atime;			/* Time of last access.  */
     __time_t st_atime;			/* Time of last access.  */
@@ -112,11 +113,15 @@ struct stat64
 #define	__S_IFBLK	0060000	/* Block device.  */
 #define	__S_IFBLK	0060000	/* Block device.  */
 #define	__S_IFREG	0100000	/* Regular file.  */
 #define	__S_IFREG	0100000	/* Regular file.  */
 #define	__S_IFIFO	0010000	/* FIFO.  */
 #define	__S_IFIFO	0010000	/* FIFO.  */
-
-/* These don't actually exist on System V, but having them doesn't hurt.  */
 #define	__S_IFLNK	0120000	/* Symbolic link.  */
 #define	__S_IFLNK	0120000	/* Symbolic link.  */
 #define	__S_IFSOCK	0140000	/* Socket.  */
 #define	__S_IFSOCK	0140000	/* Socket.  */
 
 
+/* POSIX.1b objects.  Note that these macros always evaluate to zero.  But
+   they do it by enforcing the correct use of the macros.  */
+#define __S_TYPEISMQ(buf)  ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode)
+
 /* Protection bits.  */
 /* Protection bits.  */
 
 
 #define	__S_ISUID	04000	/* Set user ID on execution.  */
 #define	__S_ISUID	04000	/* Set user ID on execution.  */

+ 12 - 9
libc/sysdeps/linux/sparc/bits/statfs.h

@@ -1,20 +1,20 @@
-/* Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #ifndef _SYS_STATFS_H
 #ifndef _SYS_STATFS_H
 # error "Never include <bits/statfs.h> directly; use <sys/statfs.h> instead."
 # error "Never include <bits/statfs.h> directly; use <sys/statfs.h> instead."
@@ -59,3 +59,6 @@ struct statfs64
     long int f_spare[6];
     long int f_spare[6];
   };
   };
 #endif
 #endif
+
+/* Tell code we have these members.  */
+#define _STATFS_F_NAMELEN

+ 35 - 23
libc/sysdeps/linux/sparc/bits/statvfs.h

@@ -1,26 +1,30 @@
-/* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #ifndef _SYS_STATVFS_H
 #ifndef _SYS_STATVFS_H
 # error "Never include <bits/statvfs.h> directly; use <sys/statvfs.h> instead."
 # error "Never include <bits/statvfs.h> directly; use <sys/statvfs.h> instead."
 #endif
 #endif
 
 
-#include <bits/types.h>  /* For __fsid_t, __fsblkcnt_t and __fsfilcnt_t.  */
+#include <bits/types.h>  /* For __fsblkcnt_t and __fsfilcnt_t.  */
+
+#if __WORDSIZE == 32
+#define _STATVFSBUF_F_UNUSED
+#endif
 
 
 struct statvfs
 struct statvfs
   {
   {
@@ -41,10 +45,13 @@ struct statvfs
     __fsfilcnt64_t f_ffree;
     __fsfilcnt64_t f_ffree;
     __fsfilcnt64_t f_favail;
     __fsfilcnt64_t f_favail;
 #endif
 #endif
-    __fsid_t f_fsid;
+    unsigned long int f_fsid;
+#ifdef _STATVFSBUF_F_UNUSED
+    int __f_unused;
+#endif
     unsigned long int f_flag;
     unsigned long int f_flag;
     unsigned long int f_namemax;
     unsigned long int f_namemax;
-    int f_spare[6];
+    int __f_spare[6];
   };
   };
 
 
 #ifdef __USE_LARGEFILE64
 #ifdef __USE_LARGEFILE64
@@ -58,10 +65,13 @@ struct statvfs64
     __fsfilcnt64_t f_files;
     __fsfilcnt64_t f_files;
     __fsfilcnt64_t f_ffree;
     __fsfilcnt64_t f_ffree;
     __fsfilcnt64_t f_favail;
     __fsfilcnt64_t f_favail;
-    __fsid_t f_fsid;
+    unsigned long int f_fsid;
+#ifdef _STATVFSBUF_F_UNUSED
+    int __f_unused;
+#endif
     unsigned long int f_flag;
     unsigned long int f_flag;
     unsigned long int f_namemax;
     unsigned long int f_namemax;
-    int f_spare[6];
+    int __f_spare[6];
   };
   };
 #endif
 #endif
 
 
@@ -73,22 +83,24 @@ enum
 #define ST_RDONLY	ST_RDONLY
 #define ST_RDONLY	ST_RDONLY
   ST_NOSUID = 2,		/* Ignore suid and sgid bits.  */
   ST_NOSUID = 2,		/* Ignore suid and sgid bits.  */
 #define ST_NOSUID	ST_NOSUID
 #define ST_NOSUID	ST_NOSUID
+#ifdef __USE_GNU
   ST_NODEV = 4,			/* Disallow access to device special files.  */
   ST_NODEV = 4,			/* Disallow access to device special files.  */
-#define ST_NODEV	ST_NODEV
+# define ST_NODEV	ST_NODEV
   ST_NOEXEC = 8,		/* Disallow program execution.  */
   ST_NOEXEC = 8,		/* Disallow program execution.  */
-#define ST_NOEXEC	ST_NOEXEC
+# define ST_NOEXEC	ST_NOEXEC
   ST_SYNCHRONOUS = 16,		/* Writes are synced at once.  */
   ST_SYNCHRONOUS = 16,		/* Writes are synced at once.  */
-#define ST_SYNCHRONOUS	ST_SYNCHRONOUS
+# define ST_SYNCHRONOUS	ST_SYNCHRONOUS
   ST_MANDLOCK = 64,		/* Allow mandatory locks on an FS.  */
   ST_MANDLOCK = 64,		/* Allow mandatory locks on an FS.  */
-#define ST_MANDLOCK	ST_MANDLOCK
+# define ST_MANDLOCK	ST_MANDLOCK
   ST_WRITE = 128,		/* Write on file/directory/symlink.  */
   ST_WRITE = 128,		/* Write on file/directory/symlink.  */
-#define ST_WRITE	ST_WRITE
+# define ST_WRITE	ST_WRITE
   ST_APPEND = 256,		/* Append-only file.  */
   ST_APPEND = 256,		/* Append-only file.  */
-#define ST_APPEND	ST_APPEND
+# define ST_APPEND	ST_APPEND
   ST_IMMUTABLE = 512,		/* Immutable file.  */
   ST_IMMUTABLE = 512,		/* Immutable file.  */
-#define ST_IMMUTABLE	ST_IMMUTABLE
+# define ST_IMMUTABLE	ST_IMMUTABLE
   ST_NOATIME = 1024,		/* Do not update access times.  */
   ST_NOATIME = 1024,		/* Do not update access times.  */
-#define ST_NOATIME	ST_NOATIME
+# define ST_NOATIME	ST_NOATIME
   ST_NODIRATIME			/* Do not update directory access times.  */
   ST_NODIRATIME			/* Do not update directory access times.  */
-#define ST_NODIRATIME	ST_NODIRATIME
+# define ST_NODIRATIME	ST_NODIRATIME
+#endif	/* Use GNU.  */
 };
 };

+ 32 - 23
libc/sysdeps/linux/sparc/bits/stdio-lock.h

@@ -1,39 +1,48 @@
-/* Thread package specific definitions of stream lock type.
+/* Thread package specific definitions of stream lock type.  Generic version.
-   Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 2000, 2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
-#include <pthread.h>
+#ifndef _BITS_STDIO_LOCK_H
+#define _BITS_STDIO_LOCK_H 1
 
 
-typedef pthread_mutex_t _IO_lock_t;
+#include <bits/libc-lock.h>
+
+__libc_lock_define_recursive (typedef, _IO_lock_t)
 
 
 /* We need recursive (counting) mutexes.  */
 /* We need recursive (counting) mutexes.  */
-#define _IO_lock_initializer PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+#ifdef _LIBC_LOCK_RECURSIVE_INITIALIZER
+# define _IO_lock_initializer _LIBC_LOCK_RECURSIVE_INITIALIZER
+#elif _IO_MTSAFE_IO
+ #error libio needs recursive mutexes for _IO_MTSAFE_IO
+#endif
+
+#define _IO_lock_init(_name)	__libc_lock_init_recursive (_name)
+#define _IO_lock_fini(_name)	__libc_lock_fini_recursive (_name)
+#define _IO_lock_lock(_name)	__libc_lock_lock_recursive (_name)
+#define _IO_lock_unlock(_name)	__libc_lock_unlock_recursive (_name)
 
 
 
 
 #define _IO_cleanup_region_start(_fct, _fp) \
 #define _IO_cleanup_region_start(_fct, _fp) \
-     __libc_cleanup_region_start (_fct, _fp)
+  __libc_cleanup_region_start (((_fp)->_flags & _IO_USER_LOCK) == 0, _fct, _fp)
+#define _IO_cleanup_region_start_noarg(_fct) \
+  __libc_cleanup_region_start (1, _fct, NULL)
 #define _IO_cleanup_region_end(_doit) \
 #define _IO_cleanup_region_end(_doit) \
-     __libc_cleanup_region_end (_doit)
+  __libc_cleanup_region_end (_doit)
-#define _IO_lock_init(_name) \
+
-     __libc_lock_init_recursive (_name)
+
-#define _IO_lock_fini(_name) \
+#endif /* bits/stdio-lock.h */
-     __libc_lock_fini_recursive (_name)
-#define _IO_lock_lock(_name) \
-     __libc_lock_lock (_name)
-#define _IO_lock_unlock(_name) \
-     __libc_lock_unlock (_name)

+ 21 - 20
libc/sysdeps/linux/sparc/bits/stdio.h

@@ -1,20 +1,21 @@
 /* Optimizing macros and inline functions for stdio functions.
 /* Optimizing macros and inline functions for stdio functions.
-   Copyright (C) 198 Free Software Foundation, Inc.
+   Copyright (C) 1998, 2000, 2001 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
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #ifndef _STDIO_H
 #ifndef _STDIO_H
 # error "Never include <bits/stdio.h> directly; use <stdio.h> instead."
 # error "Never include <bits/stdio.h> directly; use <stdio.h> instead."
@@ -30,14 +31,14 @@
 #ifdef __USE_EXTERN_INLINES
 #ifdef __USE_EXTERN_INLINES
 /* Write formatted output to stdout from argument list ARG.  */
 /* Write formatted output to stdout from argument list ARG.  */
 __STDIO_INLINE int
 __STDIO_INLINE int
-vprintf (__const char *__restrict __fmt, _G_va_list __arg)
+vprintf (__const char *__restrict __fmt, _G_va_list __arg) __THROW
 {
 {
   return vfprintf (stdout, __fmt, __arg);
   return vfprintf (stdout, __fmt, __arg);
 }
 }
 
 
 /* Read a character from stdin.  */
 /* Read a character from stdin.  */
 __STDIO_INLINE int
 __STDIO_INLINE int
-getchar (void)
+getchar (void) __THROW
 {
 {
   return _IO_getc (stdin);
   return _IO_getc (stdin);
 }
 }
@@ -46,14 +47,14 @@ getchar (void)
 # if defined __USE_POSIX || defined __USE_MISC
 # if defined __USE_POSIX || defined __USE_MISC
 /* This is defined in POSIX.1:1996.  */
 /* This is defined in POSIX.1:1996.  */
 __STDIO_INLINE int
 __STDIO_INLINE int
-getc_unlocked (FILE *__fp)
+getc_unlocked (FILE *__fp) __THROW
 {
 {
   return _IO_getc_unlocked (__fp);
   return _IO_getc_unlocked (__fp);
 }
 }
 
 
 /* This is defined in POSIX.1:1996.  */
 /* This is defined in POSIX.1:1996.  */
 __STDIO_INLINE int
 __STDIO_INLINE int
-getchar_unlocked (void)
+getchar_unlocked (void) __THROW
 {
 {
   return _IO_getc_unlocked (stdin);
   return _IO_getc_unlocked (stdin);
 }
 }
@@ -62,7 +63,7 @@ getchar_unlocked (void)
 
 
 /* Write a character to stdout.  */
 /* Write a character to stdout.  */
 __STDIO_INLINE int
 __STDIO_INLINE int
-putchar (int __c)
+putchar (int __c) __THROW
 {
 {
   return _IO_putc (__c, stdout);
   return _IO_putc (__c, stdout);
 }
 }
@@ -71,7 +72,7 @@ putchar (int __c)
 # ifdef __USE_MISC
 # ifdef __USE_MISC
 /* Faster version when locking is not necessary.  */
 /* Faster version when locking is not necessary.  */
 __STDIO_INLINE int
 __STDIO_INLINE int
-fputc_unlocked (int __c, FILE *__stream)
+fputc_unlocked (int __c, FILE *__stream) __THROW
 {
 {
   return _IO_putc_unlocked (__c, __stream);
   return _IO_putc_unlocked (__c, __stream);
 }
 }
@@ -81,14 +82,14 @@ fputc_unlocked (int __c, FILE *__stream)
 # if defined __USE_POSIX || defined __USE_MISC
 # if defined __USE_POSIX || defined __USE_MISC
 /* This is defined in POSIX.1:1996.  */
 /* This is defined in POSIX.1:1996.  */
 __STDIO_INLINE int
 __STDIO_INLINE int
-putc_unlocked (int __c, FILE *__stream)
+putc_unlocked (int __c, FILE *__stream) __THROW
 {
 {
   return _IO_putc_unlocked (__c, __stream);
   return _IO_putc_unlocked (__c, __stream);
 }
 }
 
 
 /* This is defined in POSIX.1:1996.  */
 /* This is defined in POSIX.1:1996.  */
 __STDIO_INLINE int
 __STDIO_INLINE int
-putchar_unlocked (int __c)
+putchar_unlocked (int __c) __THROW
 {
 {
   return _IO_putc_unlocked (__c, stdout);
   return _IO_putc_unlocked (__c, stdout);
 }
 }
@@ -98,7 +99,7 @@ putchar_unlocked (int __c)
 # ifdef	__USE_GNU
 # ifdef	__USE_GNU
 /* Like `getdelim', but reads up to a newline.  */
 /* Like `getdelim', but reads up to a newline.  */
 __STDIO_INLINE _IO_ssize_t
 __STDIO_INLINE _IO_ssize_t
-getline (char **__lineptr, size_t *__n, FILE *__stream)
+getline (char **__lineptr, size_t *__n, FILE *__stream) __THROW
 {
 {
   return __getdelim (__lineptr, __n, '\n', __stream);
   return __getdelim (__lineptr, __n, '\n', __stream);
 }
 }
@@ -108,14 +109,14 @@ getline (char **__lineptr, size_t *__n, FILE *__stream)
 # ifdef __USE_MISC
 # ifdef __USE_MISC
 /* Faster versions when locking is not required.  */
 /* Faster versions when locking is not required.  */
 __STDIO_INLINE int
 __STDIO_INLINE int
-feof_unlocked (FILE *__stream)
+feof_unlocked (FILE *__stream) __THROW
 {
 {
   return _IO_feof_unlocked (__stream);
   return _IO_feof_unlocked (__stream);
 }
 }
 
 
 /* Faster versions when locking is not required.  */
 /* Faster versions when locking is not required.  */
 __STDIO_INLINE int
 __STDIO_INLINE int
-ferror_unlocked (FILE *__stream)
+ferror_unlocked (FILE *__stream) __THROW
 {
 {
   return _IO_ferror_unlocked (__stream);
   return _IO_ferror_unlocked (__stream);
 }
 }

+ 16 - 12
libc/sysdeps/linux/sparc/bits/stdio_lim.h

@@ -1,29 +1,29 @@
-/* Copyright (C) 1994, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1994, 1997, 1998, 1999 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
-#if !defined _STDIO_H && !defined __need_FOPEN_MAX
+#if !defined _STDIO_H && !defined __need_FOPEN_MAX && !defined __need_IOV_MAX
 # error "Never include <bits/stdio_lim.h> directly; use <stdio.h> instead."
 # error "Never include <bits/stdio_lim.h> directly; use <stdio.h> instead."
 #endif
 #endif
 
 
 #ifdef _STDIO_H
 #ifdef _STDIO_H
 # define L_tmpnam 20
 # define L_tmpnam 20
 # define TMP_MAX 238328
 # define TMP_MAX 238328
-# define FILENAME_MAX 255
+# define FILENAME_MAX 4095 
 
 
 # ifdef __USE_POSIX
 # ifdef __USE_POSIX
 #  define L_ctermid 9
 #  define L_ctermid 9
@@ -33,5 +33,9 @@
 
 
 #if defined __need_FOPEN_MAX || defined _STDIO_H
 #if defined __need_FOPEN_MAX || defined _STDIO_H
 # undef  FOPEN_MAX
 # undef  FOPEN_MAX
-# define FOPEN_MAX 256 
+# define FOPEN_MAX 16
+#endif
+
+#if defined __need_IOV_MAX && !defined IOV_MAX
+# define IOV_MAX 1024 
 #endif
 #endif

+ 21 - 7
libc/sysdeps/linux/sparc/bits/string.h

@@ -1,12 +1,26 @@
-/* This file should provide inline versions of string functions.
+/* Optimized, inlined string functions.  SPARC version.
+   Copyright (C) 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
 
 
-   Surround GCC-specific parts with #ifdef __GNUC__, and use `extern __inline'.
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
 
-   This file should define __STRING_INLINES if functions are actually defined
+   The GNU C Library is distributed in the hope that it will be useful,
-   as inlines.  */
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
 
 
-#ifndef _BITS_STRING_H
+   You should have received a copy of the GNU Lesser General Public
-#define _BITS_STRING_H	1
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 
+#ifndef _STRING_H
+# error "Never use <bits/string.h> directly; include <string.h> instead."
+#endif
 
 
-#endif /* bits/string.h */
+/* sparc32 and sparc64 strchr(x, '\0') perform better than
+   __rawmemchr(x, '\0').  */
+#define _HAVE_STRING_ARCH_strchr 1

+ 170 - 143
libc/sysdeps/linux/sparc/bits/string2.h

@@ -1,28 +1,28 @@
 /* Machine-independant string function optimizations.
 /* Machine-independant string function optimizations.
-   Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #ifndef _STRING_H
 #ifndef _STRING_H
 # error "Never use <bits/string2.h> directly; include <string.h> instead."
 # error "Never use <bits/string2.h> directly; include <string.h> instead."
 #endif
 #endif
 
 
-#ifndef __NO_STRING_INLINES
+#if !defined __NO_STRING_INLINES && !defined __BOUNDED_POINTERS__
 
 
 /* Unlike the definitions in the header <bits/string.h> the
 /* Unlike the definitions in the header <bits/string.h> the
    definitions contained here are not optimized down to assembler
    definitions contained here are not optimized down to assembler
@@ -186,8 +186,7 @@ __STRING2_COPY_TYPE (8);
 
 
 /* GCC optimizes memset(s, 0, n) but not bzero(s, n).
 /* GCC optimizes memset(s, 0, n) but not bzero(s, n).
    The optimization is broken before EGCS 1.1.  */
    The optimization is broken before EGCS 1.1.  */
-# if defined __GNUC__ \
+# if __GNUC_PREREQ (2, 91)
-     && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 90))
 #  define __bzero(s, n) __builtin_memset (s, '\0', n)
 #  define __bzero(s, n) __builtin_memset (s, '\0', n)
 # endif
 # endif
 
 
@@ -197,24 +196,28 @@ __STRING2_COPY_TYPE (8);
 /* Copy N bytes from SRC to DEST, returning pointer to byte following the
 /* Copy N bytes from SRC to DEST, returning pointer to byte following the
    last copied.  */
    last copied.  */
 #ifdef __USE_GNU
 #ifdef __USE_GNU
-# ifndef _HAVE_STRING_ARCH_mempcpy
+# if !defined _HAVE_STRING_ARCH_mempcpy || defined _FORCE_INLINES
-#  define __mempcpy(dest, src, n) \
+#  ifndef _HAVE_STRING_ARCH_mempcpy
+#   define __mempcpy(dest, src, n) \
   (__extension__ (__builtin_constant_p (src) && __builtin_constant_p (n)      \
   (__extension__ (__builtin_constant_p (src) && __builtin_constant_p (n)      \
 		  && __string2_1bptr_p (src) && n <= 8			      \
 		  && __string2_1bptr_p (src) && n <= 8			      \
 		  ? __mempcpy_small (dest, __mempcpy_args (src), n)	      \
 		  ? __mempcpy_small (dest, __mempcpy_args (src), n)	      \
 		  : __mempcpy (dest, src, n)))
 		  : __mempcpy (dest, src, n)))
 /* In glibc we use this function frequently but for namespace reasons
 /* In glibc we use this function frequently but for namespace reasons
    we have to use the name `__mempcpy'.  */
    we have to use the name `__mempcpy'.  */
-#  define mempcpy(dest, src, n) __mempcpy (dest, src, n)
+#   define mempcpy(dest, src, n) __mempcpy (dest, src, n)
+#  endif
 
 
 #  if _STRING_ARCH_unaligned
 #  if _STRING_ARCH_unaligned
-#   define __mempcpy_args(src) \
+#   ifndef _FORCE_INLINES
-     ((char *) (src))[0], ((char *) (src))[2], ((char *) (src))[4],	      \
+#    define __mempcpy_args(src) \
-     ((char *) (src))[6],						      \
+     ((__const char *) (src))[0], ((__const char *) (src))[2],		      \
+     ((__const char *) (src))[4], ((__const char *) (src))[6],		      \
      __extension__ __STRING2_SMALL_GET16 (src, 0),			      \
      __extension__ __STRING2_SMALL_GET16 (src, 0),			      \
      __extension__ __STRING2_SMALL_GET16 (src, 4),			      \
      __extension__ __STRING2_SMALL_GET16 (src, 4),			      \
      __extension__ __STRING2_SMALL_GET32 (src, 0),			      \
      __extension__ __STRING2_SMALL_GET32 (src, 0),			      \
      __extension__ __STRING2_SMALL_GET32 (src, 4)
      __extension__ __STRING2_SMALL_GET32 (src, 4)
+#   endif
 __STRING_INLINE void *__mempcpy_small (void *, char, char, char, char,
 __STRING_INLINE void *__mempcpy_small (void *, char, char, char, char,
 				       __uint16_t, __uint16_t, __uint32_t,
 				       __uint16_t, __uint16_t, __uint32_t,
 				       __uint32_t, size_t);
 				       __uint32_t, size_t);
@@ -281,7 +284,8 @@ __mempcpy_small (void *__dest1,
   return (void *) __u;
   return (void *) __u;
 }
 }
 #  else
 #  else
-#   define __mempcpy_args(src) \
+#   ifndef _FORCE_INLINES
+#    define __mempcpy_args(src) \
      ((__const char *) (src))[0],					      \
      ((__const char *) (src))[0],					      \
      __extension__ ((__STRING2_COPY_ARR2)				      \
      __extension__ ((__STRING2_COPY_ARR2)				      \
       { { ((__const char *) (src))[0], ((__const char *) (src))[1] } }),      \
       { { ((__const char *) (src))[0], ((__const char *) (src))[1] } }),      \
@@ -309,6 +313,7 @@ __mempcpy_small (void *__dest1,
 	  ((__const char *) (src))[2], ((__const char *) (src))[3],	      \
 	  ((__const char *) (src))[2], ((__const char *) (src))[3],	      \
 	  ((__const char *) (src))[4], ((__const char *) (src))[5],	      \
 	  ((__const char *) (src))[4], ((__const char *) (src))[5],	      \
 	  ((__const char *) (src))[6], ((__const char *) (src))[7] } })
 	  ((__const char *) (src))[6], ((__const char *) (src))[7] } })
+#   endif
 __STRING_INLINE void *__mempcpy_small (void *, char, __STRING2_COPY_ARR2,
 __STRING_INLINE void *__mempcpy_small (void *, char, __STRING2_COPY_ARR2,
 				       __STRING2_COPY_ARR3,
 				       __STRING2_COPY_ARR3,
 				       __STRING2_COPY_ARR4,
 				       __STRING2_COPY_ARR4,
@@ -369,7 +374,7 @@ __mempcpy_small (void *__dest, char __src1,
 
 
 /* Return pointer to C in S.  */
 /* Return pointer to C in S.  */
 #ifndef _HAVE_STRING_ARCH_strchr
 #ifndef _HAVE_STRING_ARCH_strchr
-extern __ptr_t __rawmemchr (const __ptr_t __s, int __c);
+extern void *__rawmemchr (const void *__s, int __c);
 # define strchr(s, c) \
 # define strchr(s, c) \
   (__extension__ (__builtin_constant_p (c) && (c) == '\0'		      \
   (__extension__ (__builtin_constant_p (c) && (c) == '\0'		      \
 		  ? (char *) __rawmemchr (s, c)				      \
 		  ? (char *) __rawmemchr (s, c)				      \
@@ -378,21 +383,25 @@ extern __ptr_t __rawmemchr (const __ptr_t __s, int __c);
 
 
 
 
 /* Copy SRC to DEST.  */
 /* Copy SRC to DEST.  */
-#ifndef _HAVE_STRING_ARCH_strcpy
+#if !defined _HAVE_STRING_ARCH_strcpy || defined _FORCE_INLINES
-# define strcpy(dest, src) \
+# ifndef _HAVE_STRING_ARCH_strcpy
+#  define strcpy(dest, src) \
   (__extension__ (__builtin_constant_p (src)				      \
   (__extension__ (__builtin_constant_p (src)				      \
 		  ? (__string2_1bptr_p (src) && strlen (src) + 1 <= 8	      \
 		  ? (__string2_1bptr_p (src) && strlen (src) + 1 <= 8	      \
 		     ? __strcpy_small (dest, __strcpy_args (src),	      \
 		     ? __strcpy_small (dest, __strcpy_args (src),	      \
 				       strlen (src) + 1)		      \
 				       strlen (src) + 1)		      \
 		     : (char *) memcpy (dest, src, strlen (src) + 1))	      \
 		     : (char *) memcpy (dest, src, strlen (src) + 1))	      \
 		  : strcpy (dest, src)))
 		  : strcpy (dest, src)))
+# endif
 
 
 # if _STRING_ARCH_unaligned
 # if _STRING_ARCH_unaligned
-#  define __strcpy_args(src) \
+#  ifndef _FORCE_INLINES
+#   define __strcpy_args(src) \
      __extension__ __STRING2_SMALL_GET16 (src, 0),			      \
      __extension__ __STRING2_SMALL_GET16 (src, 0),			      \
      __extension__ __STRING2_SMALL_GET16 (src, 4),			      \
      __extension__ __STRING2_SMALL_GET16 (src, 4),			      \
      __extension__ __STRING2_SMALL_GET32 (src, 0),			      \
      __extension__ __STRING2_SMALL_GET32 (src, 0),			      \
      __extension__ __STRING2_SMALL_GET32 (src, 4)
      __extension__ __STRING2_SMALL_GET32 (src, 4)
+#  endif
 __STRING_INLINE char *__strcpy_small (char *, __uint16_t, __uint16_t,
 __STRING_INLINE char *__strcpy_small (char *, __uint16_t, __uint16_t,
 				      __uint32_t, __uint32_t, size_t);
 				      __uint32_t, __uint32_t, size_t);
 __STRING_INLINE char *
 __STRING_INLINE char *
@@ -448,7 +457,8 @@ __strcpy_small (char *__dest,
   return __dest;
   return __dest;
 }
 }
 # else
 # else
-#  define __strcpy_args(src) \
+#  ifndef _FORCE_INLINES
+#   define __strcpy_args(src) \
      __extension__ ((__STRING2_COPY_ARR2)				      \
      __extension__ ((__STRING2_COPY_ARR2)				      \
       { { ((__const char *) (src))[0], '\0' } }),			      \
       { { ((__const char *) (src))[0], '\0' } }),			      \
      __extension__ ((__STRING2_COPY_ARR3)				      \
      __extension__ ((__STRING2_COPY_ARR3)				      \
@@ -475,6 +485,7 @@ __strcpy_small (char *__dest,
 	  ((__const char *) (src))[2], ((__const char *) (src))[3],	      \
 	  ((__const char *) (src))[2], ((__const char *) (src))[3],	      \
 	  ((__const char *) (src))[4], ((__const char *) (src))[5],	      \
 	  ((__const char *) (src))[4], ((__const char *) (src))[5],	      \
 	  ((__const char *) (src))[6], '\0' } })
 	  ((__const char *) (src))[6], '\0' } })
+#  endif
 __STRING_INLINE char *__strcpy_small (char *, __STRING2_COPY_ARR2,
 __STRING_INLINE char *__strcpy_small (char *, __STRING2_COPY_ARR2,
 				      __STRING2_COPY_ARR3,
 				      __STRING2_COPY_ARR3,
 				      __STRING2_COPY_ARR4,
 				      __STRING2_COPY_ARR4,
@@ -534,8 +545,9 @@ __strcpy_small (char *__dest,
 
 
 /* Copy SRC to DEST, returning pointer to final NUL byte.  */
 /* Copy SRC to DEST, returning pointer to final NUL byte.  */
 #ifdef __USE_GNU
 #ifdef __USE_GNU
-# ifndef _HAVE_STRING_ARCH_stpcpy
+# if !defined _HAVE_STRING_ARCH_stpcpy || defined _FORCE_INLINES
-#  define __stpcpy(dest, src) \
+#  ifndef _HAVE_STRING_ARCH_stpcpy
+#   define __stpcpy(dest, src) \
   (__extension__ (__builtin_constant_p (src)				      \
   (__extension__ (__builtin_constant_p (src)				      \
 		  ? (__string2_1bptr_p (src) && strlen (src) + 1 <= 8	      \
 		  ? (__string2_1bptr_p (src) && strlen (src) + 1 <= 8	      \
 		     ? __stpcpy_small (dest, __stpcpy_args (src),	      \
 		     ? __stpcpy_small (dest, __stpcpy_args (src),	      \
@@ -544,14 +556,17 @@ __strcpy_small (char *__dest,
 		  : __stpcpy (dest, src)))
 		  : __stpcpy (dest, src)))
 /* In glibc we use this function frequently but for namespace reasons
 /* In glibc we use this function frequently but for namespace reasons
    we have to use the name `__stpcpy'.  */
    we have to use the name `__stpcpy'.  */
-#  define stpcpy(dest, src) __stpcpy (dest, src)
+#   define stpcpy(dest, src) __stpcpy (dest, src)
+#  endif
 
 
 #  if _STRING_ARCH_unaligned
 #  if _STRING_ARCH_unaligned
-#   define __stpcpy_args(src) \
+#   ifndef _FORCE_INLINES
+#    define __stpcpy_args(src) \
      __extension__ __STRING2_SMALL_GET16 (src, 0),			      \
      __extension__ __STRING2_SMALL_GET16 (src, 0),			      \
      __extension__ __STRING2_SMALL_GET16 (src, 4),			      \
      __extension__ __STRING2_SMALL_GET16 (src, 4),			      \
      __extension__ __STRING2_SMALL_GET32 (src, 0),			      \
      __extension__ __STRING2_SMALL_GET32 (src, 0),			      \
      __extension__ __STRING2_SMALL_GET32 (src, 4)
      __extension__ __STRING2_SMALL_GET32 (src, 4)
+#   endif
 __STRING_INLINE char *__stpcpy_small (char *, __uint16_t, __uint16_t,
 __STRING_INLINE char *__stpcpy_small (char *, __uint16_t, __uint16_t,
 				      __uint32_t, __uint32_t, size_t);
 				      __uint32_t, __uint32_t, size_t);
 __STRING_INLINE char *
 __STRING_INLINE char *
@@ -612,7 +627,8 @@ __stpcpy_small (char *__dest,
   return &__u->__c;
   return &__u->__c;
 }
 }
 #  else
 #  else
-#  define __stpcpy_args(src) \
+#   ifndef _FORCE_INLINES
+#    define __stpcpy_args(src) \
      __extension__ ((__STRING2_COPY_ARR2)				      \
      __extension__ ((__STRING2_COPY_ARR2)				      \
       { { ((__const char *) (src))[0], '\0' } }),			      \
       { { ((__const char *) (src))[0], '\0' } }),			      \
      __extension__ ((__STRING2_COPY_ARR3)				      \
      __extension__ ((__STRING2_COPY_ARR3)				      \
@@ -639,6 +655,7 @@ __stpcpy_small (char *__dest,
 	  ((__const char *) (src))[2], ((__const char *) (src))[3],	      \
 	  ((__const char *) (src))[2], ((__const char *) (src))[3],	      \
 	  ((__const char *) (src))[4], ((__const char *) (src))[5],	      \
 	  ((__const char *) (src))[4], ((__const char *) (src))[5],	      \
 	  ((__const char *) (src))[6], '\0' } })
 	  ((__const char *) (src))[6], '\0' } })
+#   endif
 __STRING_INLINE char *__stpcpy_small (char *, __STRING2_COPY_ARR2,
 __STRING_INLINE char *__stpcpy_small (char *, __STRING2_COPY_ARR2,
 				      __STRING2_COPY_ARR3,
 				      __STRING2_COPY_ARR3,
 				      __STRING2_COPY_ARR4,
 				      __STRING2_COPY_ARR4,
@@ -699,7 +716,7 @@ __stpcpy_small (char *__dest,
 
 
 /* Copy no more than N characters of SRC to DEST.  */
 /* Copy no more than N characters of SRC to DEST.  */
 #ifndef _HAVE_STRING_ARCH_strncpy
 #ifndef _HAVE_STRING_ARCH_strncpy
-# if defined _HAVE_STRING_ARCH_memset && defined _HAVE_STRING_ARCH_mempcpy
+# if defined _USE_STRING_ARCH_memset && defined _USE_STRING_ARCH_mempcpy
 #  define strncpy(dest, src, n) \
 #  define strncpy(dest, src, n) \
   (__extension__ ({ char *__dest = (dest);				      \
   (__extension__ ({ char *__dest = (dest);				      \
 		    __builtin_constant_p (src) && __builtin_constant_p (n)    \
 		    __builtin_constant_p (src) && __builtin_constant_p (n)    \
@@ -722,13 +739,14 @@ __stpcpy_small (char *__dest,
 
 
 /* Append no more than N characters from SRC onto DEST.  */
 /* Append no more than N characters from SRC onto DEST.  */
 #ifndef _HAVE_STRING_ARCH_strncat
 #ifndef _HAVE_STRING_ARCH_strncat
-# ifdef _HAVE_STRING_ARCH_strchr
+# ifdef _USE_STRING_ARCH_strchr
 #  define strncat(dest, src, n) \
 #  define strncat(dest, src, n) \
   (__extension__ ({ char *__dest = (dest);				      \
   (__extension__ ({ char *__dest = (dest);				      \
 		    __builtin_constant_p (src) && __builtin_constant_p (n)    \
 		    __builtin_constant_p (src) && __builtin_constant_p (n)    \
 		    ? (strlen (src) < ((size_t) (n))			      \
 		    ? (strlen (src) < ((size_t) (n))			      \
 		       ? strcat (__dest, src)				      \
 		       ? strcat (__dest, src)				      \
-		       : (memcpy (strchr (__dest, '\0'), src, n), __dest))    \
+		       : (*((char *) __mempcpy (strchr (__dest, '\0'),	      \
+						src, n)) = '\0', __dest))     \
 		    : strncat (dest, src, n); }))
 		    : strncat (dest, src, n); }))
 # else
 # else
 #  define strncat(dest, src, n) \
 #  define strncat(dest, src, n) \
@@ -854,8 +872,9 @@ __stpcpy_small (char *__dest,
 
 
 /* Return the length of the initial segment of S which
 /* Return the length of the initial segment of S which
    consists entirely of characters not in REJECT.  */
    consists entirely of characters not in REJECT.  */
-#ifndef _HAVE_STRING_ARCH_strcspn
+#if !defined _HAVE_STRING_ARCH_strcspn || defined _FORCE_INLINES
-# define strcspn(s, reject) \
+# ifndef _HAVE_STRING_ARCH_strcspn
+#  define strcspn(s, reject) \
   __extension__								      \
   __extension__								      \
   ({ char __r0, __r1, __r2;						      \
   ({ char __r0, __r1, __r2;						      \
      (__builtin_constant_p (reject) && __string2_1bptr_p (reject)	      \
      (__builtin_constant_p (reject) && __string2_1bptr_p (reject)	      \
@@ -869,10 +888,11 @@ __stpcpy_small (char *__dest,
 		  ? __strcspn_c3 (s, __r0, __r1, __r2)			      \
 		  ? __strcspn_c3 (s, __r0, __r1, __r2)			      \
 		  : strcspn (s, reject)))))				      \
 		  : strcspn (s, reject)))))				      \
 		  : strcspn (s, reject)); })
 		  : strcspn (s, reject)); })
+# endif
 
 
-__STRING_INLINE size_t __strcspn_c1 (__const char *__s, char __reject);
+__STRING_INLINE size_t __strcspn_c1 (__const char *__s, int __reject);
 __STRING_INLINE size_t
 __STRING_INLINE size_t
-__strcspn_c1 (__const char *__s, char __reject)
+__strcspn_c1 (__const char *__s, int __reject)
 {
 {
   register size_t __result = 0;
   register size_t __result = 0;
   while (__s[__result] != '\0' && __s[__result] != __reject)
   while (__s[__result] != '\0' && __s[__result] != __reject)
@@ -880,10 +900,10 @@ __strcspn_c1 (__const char *__s, char __reject)
   return __result;
   return __result;
 }
 }
 
 
-__STRING_INLINE size_t __strcspn_c2 (__const char *__s, char __reject1,
+__STRING_INLINE size_t __strcspn_c2 (__const char *__s, int __reject1,
-				     char __reject2);
+				     int __reject2);
 __STRING_INLINE size_t
 __STRING_INLINE size_t
-__strcspn_c2 (__const char *__s, char __reject1, char __reject2)
+__strcspn_c2 (__const char *__s, int __reject1, int __reject2)
 {
 {
   register size_t __result = 0;
   register size_t __result = 0;
   while (__s[__result] != '\0' && __s[__result] != __reject1
   while (__s[__result] != '\0' && __s[__result] != __reject1
@@ -892,11 +912,11 @@ __strcspn_c2 (__const char *__s, char __reject1, char __reject2)
   return __result;
   return __result;
 }
 }
 
 
-__STRING_INLINE size_t __strcspn_c3 (__const char *__s, char __reject1,
+__STRING_INLINE size_t __strcspn_c3 (__const char *__s, int __reject1,
-				     char __reject2, char __reject3);
+				     int __reject2, int __reject3);
 __STRING_INLINE size_t
 __STRING_INLINE size_t
-__strcspn_c3 (__const char *__s, char __reject1, char __reject2,
+__strcspn_c3 (__const char *__s, int __reject1, int __reject2,
-	      char __reject3)
+	      int __reject3)
 {
 {
   register size_t __result = 0;
   register size_t __result = 0;
   while (__s[__result] != '\0' && __s[__result] != __reject1
   while (__s[__result] != '\0' && __s[__result] != __reject1
@@ -909,13 +929,14 @@ __strcspn_c3 (__const char *__s, char __reject1, char __reject2,
 
 
 /* Return the length of the initial segment of S which
 /* Return the length of the initial segment of S which
    consists entirely of characters in ACCEPT.  */
    consists entirely of characters in ACCEPT.  */
-#ifndef _HAVE_STRING_ARCH_strspn
+#if !defined _HAVE_STRING_ARCH_strspn || defined _FORCE_INLINES
-# define strspn(s, accept) \
+# ifndef _HAVE_STRING_ARCH_strspn
+#  define strspn(s, accept) \
   __extension__								      \
   __extension__								      \
   ({ char __a0, __a1, __a2;						      \
   ({ char __a0, __a1, __a2;						      \
      (__builtin_constant_p (accept) && __string2_1bptr_p (accept)	      \
      (__builtin_constant_p (accept) && __string2_1bptr_p (accept)	      \
       ? ((__a0 = ((__const char *) (accept))[0], __a0 == '\0')		      \
       ? ((__a0 = ((__const char *) (accept))[0], __a0 == '\0')		      \
-	 ? 0								      \
+	 ? ((void) (s), 0)						      \
 	 : ((__a1 = ((__const char *) (accept))[1], __a1 == '\0')	      \
 	 : ((__a1 = ((__const char *) (accept))[1], __a1 == '\0')	      \
 	    ? __strspn_c1 (s, __a0)					      \
 	    ? __strspn_c1 (s, __a0)					      \
 	    : ((__a2 = ((__const char *) (accept))[2], __a2 == '\0')	      \
 	    : ((__a2 = ((__const char *) (accept))[2], __a2 == '\0')	      \
@@ -924,10 +945,11 @@ __strcspn_c3 (__const char *__s, char __reject1, char __reject2,
 		  ? __strspn_c3 (s, __a0, __a1, __a2)			      \
 		  ? __strspn_c3 (s, __a0, __a1, __a2)			      \
 		  : strspn (s, accept)))))				      \
 		  : strspn (s, accept)))))				      \
       : strspn (s, accept)); })
       : strspn (s, accept)); })
+# endif
 
 
-__STRING_INLINE size_t __strspn_c1 (__const char *__s, char __accept);
+__STRING_INLINE size_t __strspn_c1 (__const char *__s, int __accept);
 __STRING_INLINE size_t
 __STRING_INLINE size_t
-__strspn_c1 (__const char *__s, char __accept)
+__strspn_c1 (__const char *__s, int __accept)
 {
 {
   register size_t __result = 0;
   register size_t __result = 0;
   /* Please note that __accept never can be '\0'.  */
   /* Please note that __accept never can be '\0'.  */
@@ -936,10 +958,10 @@ __strspn_c1 (__const char *__s, char __accept)
   return __result;
   return __result;
 }
 }
 
 
-__STRING_INLINE size_t __strspn_c2 (__const char *__s, char __accept1,
+__STRING_INLINE size_t __strspn_c2 (__const char *__s, int __accept1,
-				    char __accept2);
+				    int __accept2);
 __STRING_INLINE size_t
 __STRING_INLINE size_t
-__strspn_c2 (__const char *__s, char __accept1, char __accept2)
+__strspn_c2 (__const char *__s, int __accept1, int __accept2)
 {
 {
   register size_t __result = 0;
   register size_t __result = 0;
   /* Please note that __accept1 and __accept2 never can be '\0'.  */
   /* Please note that __accept1 and __accept2 never can be '\0'.  */
@@ -948,10 +970,10 @@ __strspn_c2 (__const char *__s, char __accept1, char __accept2)
   return __result;
   return __result;
 }
 }
 
 
-__STRING_INLINE size_t __strspn_c3 (__const char *__s, char __accept1,
+__STRING_INLINE size_t __strspn_c3 (__const char *__s, int __accept1,
-				    char __accept2, char __accept3);
+				    int __accept2, int __accept3);
 __STRING_INLINE size_t
 __STRING_INLINE size_t
-__strspn_c3 (__const char *__s, char __accept1, char __accept2, char __accept3)
+__strspn_c3 (__const char *__s, int __accept1, int __accept2, int __accept3)
 {
 {
   register size_t __result = 0;
   register size_t __result = 0;
   /* Please note that __accept1 to __accept3 never can be '\0'.  */
   /* Please note that __accept1 to __accept3 never can be '\0'.  */
@@ -964,13 +986,14 @@ __strspn_c3 (__const char *__s, char __accept1, char __accept2, char __accept3)
 
 
 
 
 /* Find the first occurrence in S of any character in ACCEPT.  */
 /* Find the first occurrence in S of any character in ACCEPT.  */
-#ifndef _HAVE_STRING_ARCH_strpbrk
+#if !defined _HAVE_STRING_ARCH_strpbrk || defined _FORCE_INLINES
-# define strpbrk(s, accept) \
+# ifndef _HAVE_STRING_ARCH_strpbrk
+#  define strpbrk(s, accept) \
   __extension__								      \
   __extension__								      \
   ({ char __a0, __a1, __a2;						      \
   ({ char __a0, __a1, __a2;						      \
      (__builtin_constant_p (accept) && __string2_1bptr_p (accept)	      \
      (__builtin_constant_p (accept) && __string2_1bptr_p (accept)	      \
       ? ((__a0 = ((__const char  *) (accept))[0], __a0 == '\0')		      \
       ? ((__a0 = ((__const char  *) (accept))[0], __a0 == '\0')		      \
-	 ? NULL								      \
+	 ? ((void) (s), NULL)						      \
 	 : ((__a1 = ((__const char *) (accept))[1], __a1 == '\0')	      \
 	 : ((__a1 = ((__const char *) (accept))[1], __a1 == '\0')	      \
 	    ? strchr (s, __a0)						      \
 	    ? strchr (s, __a0)						      \
 	    : ((__a2 = ((__const char *) (accept))[2], __a2 == '\0')	      \
 	    : ((__a2 = ((__const char *) (accept))[2], __a2 == '\0')	      \
@@ -979,11 +1002,12 @@ __strspn_c3 (__const char *__s, char __accept1, char __accept2, char __accept3)
 		  ? __strpbrk_c3 (s, __a0, __a1, __a2)			      \
 		  ? __strpbrk_c3 (s, __a0, __a1, __a2)			      \
 		  : strpbrk (s, accept)))))				      \
 		  : strpbrk (s, accept)))))				      \
       : strpbrk (s, accept)); })
       : strpbrk (s, accept)); })
+# endif
 
 
-__STRING_INLINE char *__strpbrk_c2 (__const char *__s, char __accept1,
+__STRING_INLINE char *__strpbrk_c2 (__const char *__s, int __accept1,
-				     char __accept2);
+				     int __accept2);
 __STRING_INLINE char *
 __STRING_INLINE char *
-__strpbrk_c2 (__const char *__s, char __accept1, char __accept2)
+__strpbrk_c2 (__const char *__s, int __accept1, int __accept2)
 {
 {
   /* Please note that __accept1 and __accept2 never can be '\0'.  */
   /* Please note that __accept1 and __accept2 never can be '\0'.  */
   while (*__s != '\0' && *__s != __accept1 && *__s != __accept2)
   while (*__s != '\0' && *__s != __accept1 && *__s != __accept2)
@@ -991,11 +1015,11 @@ __strpbrk_c2 (__const char *__s, char __accept1, char __accept2)
   return *__s == '\0' ? NULL : (char *) (size_t) __s;
   return *__s == '\0' ? NULL : (char *) (size_t) __s;
 }
 }
 
 
-__STRING_INLINE char *__strpbrk_c3 (__const char *__s, char __accept1,
+__STRING_INLINE char *__strpbrk_c3 (__const char *__s, int __accept1,
-				     char __accept2, char __accept3);
+				     int __accept2, int __accept3);
 __STRING_INLINE char *
 __STRING_INLINE char *
-__strpbrk_c3 (__const char *__s, char __accept1, char __accept2,
+__strpbrk_c3 (__const char *__s, int __accept1, int __accept2,
-	      char __accept3)
+	      int __accept3)
 {
 {
   /* Please note that __accept1 to __accept3 never can be '\0'.  */
   /* Please note that __accept1 to __accept3 never can be '\0'.  */
   while (*__s != '\0' && *__s != __accept1 && *__s != __accept2
   while (*__s != '\0' && *__s != __accept1 && *__s != __accept2
@@ -1006,8 +1030,9 @@ __strpbrk_c3 (__const char *__s, char __accept1, char __accept2,
 #endif
 #endif
 
 
 
 
-/* Find the first occurrence of NEEDLE in HAYSTACK.  */
+/* Find the first occurrence of NEEDLE in HAYSTACK.  Newer gcc versions
-#ifndef _HAVE_STRING_ARCH_strstr
+   do this itself.  */
+#if !defined _HAVE_STRING_ARCH_strstr && !__GNUC_PREREQ (2, 97)
 # define strstr(haystack, needle) \
 # define strstr(haystack, needle) \
   (__extension__ (__builtin_constant_p (needle) && __string2_1bptr_p (needle) \
   (__extension__ (__builtin_constant_p (needle) && __string2_1bptr_p (needle) \
 		  ? (((__const char *) (needle))[0] == '\0'		      \
 		  ? (((__const char *) (needle))[0] == '\0'		      \
@@ -1020,26 +1045,16 @@ __strpbrk_c3 (__const char *__s, char __accept1, char __accept2,
 #endif
 #endif
 
 
 
 
-#if defined __USE_GNU && !defined _FORCE_INLINES
+#if !defined _HAVE_STRING_ARCH_strtok_r || defined _FORCE_INLINES
-# ifndef _HAVE_STRING_ARCH_strnlen
+# ifndef _HAVE_STRING_ARCH_strtok_r
-__STRING_INLINE size_t
+#  define __strtok_r(s, sep, nextp) \
-strnlen (__const char *__string, size_t __maxlen)
-{
-  __const char *__end = (__const char *) memchr (__string, '\0', __maxlen);
-  return __end ? (size_t) (__end - __string) : __maxlen;
-}
-# endif
-#endif
-
-
-#ifndef _HAVE_STRING_ARCH_strtok_r
-# define __strtok_r(s, sep, nextp) \
   (__extension__ (__builtin_constant_p (sep) && __string2_1bptr_p (sep)	      \
   (__extension__ (__builtin_constant_p (sep) && __string2_1bptr_p (sep)	      \
 		  ? (((__const char *) (sep))[0] != '\0'		      \
 		  ? (((__const char *) (sep))[0] != '\0'		      \
 		     && ((__const char *) (sep))[1] == '\0'		      \
 		     && ((__const char *) (sep))[1] == '\0'		      \
 		     ? __strtok_r_1c (s, ((__const char *) (sep))[0], nextp)  \
 		     ? __strtok_r_1c (s, ((__const char *) (sep))[0], nextp)  \
 		     : __strtok_r (s, sep, nextp))			      \
 		     : __strtok_r (s, sep, nextp))			      \
 		  : __strtok_r (s, sep, nextp)))
 		  : __strtok_r (s, sep, nextp)))
+# endif
 
 
 __STRING_INLINE char *__strtok_r_1c (char *__s, char __sep, char **__nextp);
 __STRING_INLINE char *__strtok_r_1c (char *__s, char __sep, char **__nextp);
 __STRING_INLINE char *
 __STRING_INLINE char *
@@ -1050,32 +1065,31 @@ __strtok_r_1c (char *__s, char __sep, char **__nextp)
     __s = *__nextp;
     __s = *__nextp;
   while (*__s == __sep)
   while (*__s == __sep)
     ++__s;
     ++__s;
-  if (*__s == '\0')
+  __result = NULL;
-    __result = NULL;
+  if (*__s != '\0')
-  else
     {
     {
-      __result = __s;
+      __result = __s++;
-      while (*__s != '\0' && *__s != __sep)
+      while (*__s != '\0')
-	++__s;
+	if (*__s++ == __sep)
-      if (*__s == '\0')
+	  {
-	*__nextp = __s;
+	    __s[-1] = '\0';
-      else
+	    break;
-	{
+	  }
-	  *__s = '\0';
+      *__nextp = __s;
-	  *__nextp = __s + 1;
-	}
     }
     }
   return __result;
   return __result;
 }
 }
 # if defined __USE_POSIX || defined __USE_MISC
 # if defined __USE_POSIX || defined __USE_MISC
-#  define strtok_r(s, sep, nextp) __strtok_r ((s), (sep), (nextp))
+#  define strtok_r(s, sep, nextp) __strtok_r (s, sep, nextp)
 # endif
 # endif
 #endif
 #endif
 
 
 
 
-#ifndef _HAVE_STRING_ARCH_strsep
+#if !defined _HAVE_STRING_ARCH_strsep || defined _FORCE_INLINES
+# ifndef _HAVE_STRING_ARCH_strsep
 
 
-# define __strsep(s, reject) \
+extern char *__strsep_g (char **__stringp, __const char *__delim);
+#  define __strsep(s, reject) \
   __extension__								      \
   __extension__								      \
   ({ char __r0, __r1, __r2;						      \
   ({ char __r0, __r1, __r2;						      \
      (__builtin_constant_p (reject) && __string2_1bptr_p (reject)	      \
      (__builtin_constant_p (reject) && __string2_1bptr_p (reject)	      \
@@ -1090,21 +1104,15 @@ __strtok_r_1c (char *__s, char __sep, char **__nextp)
 	       ? __strsep_3c (s, __r0, __r1, __r2)			      \
 	       ? __strsep_3c (s, __r0, __r1, __r2)			      \
 	       : __strsep_g (s, reject))))				      \
 	       : __strsep_g (s, reject))))				      \
       : __strsep_g (s, reject)); })
       : __strsep_g (s, reject)); })
+# endif
 
 
 __STRING_INLINE char *__strsep_1c (char **__s, char __reject);
 __STRING_INLINE char *__strsep_1c (char **__s, char __reject);
 __STRING_INLINE char *
 __STRING_INLINE char *
 __strsep_1c (char **__s, char __reject)
 __strsep_1c (char **__s, char __reject)
 {
 {
   register char *__retval = *__s;
   register char *__retval = *__s;
-  if (__retval == NULL)
+  if (__retval != NULL && (*__s = strchr (__retval, __reject)) != NULL)
-    return *__s = NULL;
-  if (*__retval == __reject)
     *(*__s)++ = '\0';
     *(*__s)++ = '\0';
-  else
-    if ((*__s = strchr (__retval, __reject)) != NULL)
-      *(*__s)++ = '\0';
-    else
-      *__s = NULL;
   return __retval;
   return __retval;
 }
 }
 
 
@@ -1113,22 +1121,24 @@ __STRING_INLINE char *
 __strsep_2c (char **__s, char __reject1, char __reject2)
 __strsep_2c (char **__s, char __reject1, char __reject2)
 {
 {
   register char *__retval = *__s;
   register char *__retval = *__s;
-  if (__retval == NULL)
+  if (__retval != NULL)
-    return *__s = NULL;
-  if (*__retval == __reject1 || *__retval == __reject2)
-    *(*__s)++ = '\0';
-  else
     {
     {
       register char *__cp = __retval;
       register char *__cp = __retval;
-      while (*__cp != '\0' && *__cp != __reject1 && *__cp != __reject2)
+      while (1)
-	++__cp;
-      if (*__cp != '\0')
 	{
 	{
-	  *__s = __cp;
+	  if (*__cp == '\0')
-	  *(*__s)++ = '\0';
+	    {
+	      __cp = NULL;
+	  break;
+	    }
+	  if (*__cp == __reject1 || *__cp == __reject2)
+	    {
+	      *__cp++ = '\0';
+	      break;
+	    }
+	  ++__cp;
 	}
 	}
-      else
+      *__s = __cp;
-	*__s = NULL;
     }
     }
   return __retval;
   return __retval;
 }
 }
@@ -1139,41 +1149,29 @@ __STRING_INLINE char *
 __strsep_3c (char **__s, char __reject1, char __reject2, char __reject3)
 __strsep_3c (char **__s, char __reject1, char __reject2, char __reject3)
 {
 {
   register char *__retval = *__s;
   register char *__retval = *__s;
-  if (__retval == NULL)
+  if (__retval != NULL)
-    return *__s = NULL;
-  if (*__retval == __reject1 || *__retval == __reject2
-      || *__retval == __reject3)
-    *(*__s)++ = '\0';
-  else
     {
     {
       register char *__cp = __retval;
       register char *__cp = __retval;
-      while (*__cp != '\0' && *__cp != __reject1 && *__cp != __reject2
+      while (1)
-	     && *__cp != __reject3)
-	++__cp;
-      if (*__cp != '\0')
 	{
 	{
-	  *__s = __cp;
+	  if (*__cp == '\0')
-	  *(*__s)++ = '\0';
+	    {
+	      __cp = NULL;
+	  break;
+	    }
+	  if (*__cp == __reject1 || *__cp == __reject2 || *__cp == __reject3)
+	    {
+	      *__cp++ = '\0';
+	      break;
+	    }
+	  ++__cp;
 	}
 	}
-      else
+      *__s = __cp;
-	*__s = NULL;
     }
     }
   return __retval;
   return __retval;
 }
 }
-
-__STRING_INLINE char *__strsep_g (char **__s, __const char *__reject);
-__STRING_INLINE char *
-__strsep_g (char **__s, __const char *__reject)
-{
-  register char *__retval = *__s;
-  if (__retval == NULL)
-    return NULL;
-  if ((*__s = strpbrk (__retval, __reject)) != NULL)
-    *(*__s)++ = '\0';
-  return __retval;
-}
 # ifdef __USE_BSD
 # ifdef __USE_BSD
-#  define strsep(s, reject) __strsep ((s), (reject))
+#  define strsep(s, reject) __strsep (s, reject)
 # endif
 # endif
 #endif
 #endif
 
 
@@ -1189,6 +1187,7 @@ __strsep_g (char **__s, __const char *__reject)
 
 
 # ifndef _HAVE_STRING_ARCH_strdup
 # ifndef _HAVE_STRING_ARCH_strdup
 
 
+extern char *__strdup (__const char *__string) __THROW __attribute_malloc__;
 #  define __strdup(s) \
 #  define __strdup(s) \
   (__extension__ (__builtin_constant_p (s) && __string2_1bptr_p (s)	      \
   (__extension__ (__builtin_constant_p (s) && __string2_1bptr_p (s)	      \
 		  ? (((__const char *) (s))[0] == '\0'			      \
 		  ? (((__const char *) (s))[0] == '\0'			      \
@@ -1205,6 +1204,34 @@ __strsep_g (char **__s, __const char *__reject)
 #  endif
 #  endif
 # endif
 # endif
 
 
+# ifndef _HAVE_STRING_ARCH_strndup
+
+extern char *__strndup (__const char *__string, size_t __n)
+     __THROW __attribute_malloc__;
+#  define __strndup(s, n) \
+  (__extension__ (__builtin_constant_p (s) && __string2_1bptr_p (s)	      \
+		  ? (((__const char *) (s))[0] == '\0'			      \
+		     ? (char *) calloc (1, 1)				      \
+		     : ({ size_t __len = strlen (s) + 1;		      \
+			  size_t __n = (n);				      \
+			  char *__retval;				      \
+			  if (__n < __len)				      \
+			    __len = __n;				      \
+			  __retval = (char *) malloc (__len);		      \
+			  if (__retval != NULL)				      \
+			    {						      \
+			      __retval[__len - 1] = '\0';		      \
+			      __retval = (char *) memcpy (__retval, s,	      \
+							  __len - 1);	      \
+			    }						      \
+			  __retval; }))					      \
+		  : __strndup (s, n)))
+
+#  ifdef __USE_GNU
+#   define strndup(s, n) __strndup (s, n)
+#  endif
+# endif
+
 #endif /* Use misc. or use GNU.  */
 #endif /* Use misc. or use GNU.  */
 
 
 #ifndef _FORCE_INLINES
 #ifndef _FORCE_INLINES

+ 27 - 19
libc/sysdeps/linux/sparc/bits/stropts.h

@@ -1,20 +1,20 @@
-/* Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #ifndef _BITS_STROPTS_H
 #ifndef _BITS_STROPTS_H
 #define _BITS_STROPTS_H	1
 #define _BITS_STROPTS_H	1
@@ -61,7 +61,7 @@
 				   of a STREAMS pipe.  */
 				   of a STREAMS pipe.  */
 #define I_RECVFD    (__SID |14) /* Non-EFT definition.  */
 #define I_RECVFD    (__SID |14) /* Non-EFT definition.  */
 #define I_SWROPT    (__SID |19) /* Set the write mode.  */
 #define I_SWROPT    (__SID |19) /* Set the write mode.  */
-#define I_GWRSET    (__SID |20) /* Return the current write mode setting.  */
+#define I_GWROPT    (__SID |20) /* Return the current write mode setting.  */
 #define I_LIST	    (__SID |21) /* List all the module names on the STREAM, up
 #define I_LIST	    (__SID |21) /* List all the module names on the STREAM, up
 				   to and including the topmost driver name. */
 				   to and including the topmost driver name. */
 #define I_PLINK	    (__SID |22) /* Connect two STREAMs with a persistent
 #define I_PLINK	    (__SID |22) /* Connect two STREAMs with a persistent
@@ -91,7 +91,9 @@
 #define FLUSHR		0x01	/* Flush read queues.  */
 #define FLUSHR		0x01	/* Flush read queues.  */
 #define FLUSHW		0x02	/* Flush write queues.  */
 #define FLUSHW		0x02	/* Flush write queues.  */
 #define FLUSHRW		0x03	/* Flush read and write queues.  */
 #define FLUSHRW		0x03	/* Flush read and write queues.  */
-#define FLUSHBAND	0x04	/* Flush only specified band.  */
+#ifdef __USE_GNU
+# define FLUSHBAND	0x04	/* Flush only specified band.  */
+#endif
 
 
 /* Possible arguments for `I_SETSIG'.  */
 /* Possible arguments for `I_SETSIG'.  */
 #define S_INPUT		0x0001	/* A message, other than a high-priority
 #define S_INPUT		0x0001	/* A message, other than a high-priority
@@ -129,13 +131,17 @@
 #define RPROTNORM	0x0010	/* Fail `read' with EBADMSG if a message
 #define RPROTNORM	0x0010	/* Fail `read' with EBADMSG if a message
 				   containing a control part is at the front
 				   containing a control part is at the front
 				   of the STREAM head read queue.  */
 				   of the STREAM head read queue.  */
-#define RPROTMASK	0x001C	/* The RPROT bits */
+#ifdef __USE_GNU
+# define RPROTMASK	0x001C	/* The RPROT bits */
+#endif
 
 
 /* Possible mode for `I_SWROPT'.  */
 /* Possible mode for `I_SWROPT'.  */
 #define SNDZERO		0x001	/* Send a zero-length message downstream when a
 #define SNDZERO		0x001	/* Send a zero-length message downstream when a
 				   `write' of 0 bytes occurs.  */
 				   `write' of 0 bytes occurs.  */
-#define	SNDPIPE		0x002	/* Send SIGPIPE on write and putmsg if
+#ifdef __USE_GNU
+# define SNDPIPE	0x002	/* Send SIGPIPE on write and putmsg if
 				   sd_werror is set.  */
 				   sd_werror is set.  */
+#endif
 
 
 /* Arguments for `I_ATMARK'.  */
 /* Arguments for `I_ATMARK'.  */
 #define ANYMARK		0x01	/* Check if the message is marked.  */
 #define ANYMARK		0x01	/* Check if the message is marked.  */
@@ -143,8 +149,10 @@
 				   on the queue.  */
 				   on the queue.  */
 
 
 /* Argument for `I_UNLINK'.  */
 /* Argument for `I_UNLINK'.  */
-#define MUXID_ALL	(-1)	/* Unlink all STREAMs linked to the STREAM
+#ifdef __USE_GNU
+# define MUXID_ALL	(-1)	/* Unlink all STREAMs linked to the STREAM
 				   associated with `fildes'.  */
 				   associated with `fildes'.  */
+#endif
 
 
 
 
 /* Macros for `getmsg', `getpmsg', `putmsg' and `putpmsg'.  */
 /* Macros for `getmsg', `getpmsg', `putmsg' and `putpmsg'.  */
@@ -176,14 +184,14 @@ struct strpeek
   {
   {
     struct strbuf ctlbuf;
     struct strbuf ctlbuf;
     struct strbuf databuf;
     struct strbuf databuf;
-    __t_uscalar_t flags;		/* UnixWare/Solaris compatibility.  */
+    t_uscalar_t flags;			/* UnixWare/Solaris compatibility.  */
   };
   };
 
 
 struct strfdinsert
 struct strfdinsert
   {
   {
     struct strbuf ctlbuf;
     struct strbuf ctlbuf;
     struct strbuf databuf;
     struct strbuf databuf;
-    __t_uscalar_t flags;		/* UnixWare/Solaris compatibility.  */
+    t_uscalar_t flags;			/* UnixWare/Solaris compatibility.  */
     int fildes;
     int fildes;
     int offset;
     int offset;
   };
   };
@@ -199,9 +207,9 @@ struct strioctl
 struct strrecvfd
 struct strrecvfd
   {
   {
     int fd;
     int fd;
-    __uid_t uid;
+    uid_t uid;
-    __gid_t gid;
+    gid_t gid;
-    char fill[8];			/* UnixWare/Solaris compatibility */
+    char __fill[8];			/* UnixWare/Solaris compatibility */
   };
   };
 
 
 
 

+ 203 - 163
libc/sysdeps/linux/sparc/bits/syscall.h

@@ -4,189 +4,229 @@
 # error "Never use <bits/syscall.h> directly; include <sys/syscall.h> instead."
 # error "Never use <bits/syscall.h> directly; include <sys/syscall.h> instead."
 #endif
 #endif
 
 
-#define SYS_write __NR_write
+#include <bits/wordsize.h>
-#define SYS_setrlimit __NR_setrlimit
+
-#define SYS_getdents __NR_getdents
+#define SYS__llseek __NR__llseek
-#define SYS_umount __NR_umount
+#define SYS__newselect __NR__newselect
-#define SYS_munlock __NR_munlock
+#define SYS__sysctl __NR__sysctl
+#define SYS_accept __NR_accept
+#define SYS_access __NR_access
+#define SYS_acct __NR_acct
+#define SYS_adjtimex __NR_adjtimex
+#define SYS_afs_syscall __NR_afs_syscall
+#define SYS_alarm __NR_alarm
+#define SYS_aplib __NR_aplib
+#define SYS_bdflush __NR_bdflush
+#define SYS_brk __NR_brk
+#define SYS_capget __NR_capget
+#define SYS_capset __NR_capset
+#define SYS_chdir __NR_chdir
+#define SYS_chmod __NR_chmod
+#define SYS_chown __NR_chown
+#define SYS_chroot __NR_chroot
+#define SYS_clone __NR_clone
+#define SYS_close __NR_close
+#define SYS_connect __NR_connect
+#define SYS_creat __NR_creat
+#define SYS_create_module __NR_create_module
 #define SYS_delete_module __NR_delete_module
 #define SYS_delete_module __NR_delete_module
+#define SYS_dup __NR_dup
+#define SYS_dup2 __NR_dup2
+#define SYS_execv __NR_execv
+#define SYS_execve __NR_execve
+#define SYS_exit __NR_exit
+#define SYS_fchdir __NR_fchdir
+#define SYS_fchmod __NR_fchmod
+#define SYS_fchown __NR_fchown
+#define SYS_fcntl __NR_fcntl
+#define SYS_fdatasync __NR_fdatasync
+#define SYS_flock __NR_flock
+#define SYS_fork __NR_fork
 #define SYS_fstat __NR_fstat
 #define SYS_fstat __NR_fstat
+#define SYS_fstatfs __NR_fstatfs
+#define SYS_fsync __NR_fsync
+#define SYS_ftruncate __NR_ftruncate
+#define SYS_get_kernel_syms __NR_get_kernel_syms
+#define SYS_getcwd __NR_getcwd
+#define SYS_getdents __NR_getdents
+#define SYS_getdents64 __NR_getdents64
+#define SYS_getdomainname __NR_getdomainname
+#define SYS_getegid __NR_getegid
+#define SYS_geteuid __NR_geteuid
+#define SYS_getgid __NR_getgid
+#define SYS_getgroups __NR_getgroups
+#define SYS_getitimer __NR_getitimer
+#define SYS_getpagesize __NR_getpagesize
+#define SYS_getpeername __NR_getpeername
 #define SYS_getpgid __NR_getpgid
 #define SYS_getpgid __NR_getpgid
-#define SYS_rt_sigaction __NR_rt_sigaction
-#define SYS_setfsgid __NR_setfsgid
-#define SYS_chroot __NR_chroot
-#define SYS_times __NR_times
-#define SYS_rt_sigsuspend __NR_rt_sigsuspend
-#define SYS_setpgid __NR_setpgid
 #define SYS_getpgrp __NR_getpgrp
 #define SYS_getpgrp __NR_getpgrp
-#define SYS_getsockopt __NR_getsockopt
+#define SYS_getpid __NR_getpid
-#define SYS_query_module __NR_query_module
-#define SYS_pause __NR_pause
-#define SYS_writev __NR_writev
-#define SYS_rename __NR_rename
-#define SYS_truncate __NR_truncate
-#define SYS_waitpid __NR_waitpid
-#define SYS_sigreturn __NR_sigreturn
-#define SYS_readdir __NR_readdir
-#define SYS_fsync __NR_fsync
-#define SYS_sigaltstack __NR_sigaltstack
-#define SYS_lstat __NR_lstat
-#define SYS_dup2 __NR_dup2
-#define SYS_clone __NR_clone
 #define SYS_getppid __NR_getppid
 #define SYS_getppid __NR_getppid
-#define SYS_umount2 __NR_umount2
+#define SYS_getpriority __NR_getpriority
-#define SYS_close __NR_close
+#define SYS_getrlimit __NR_getrlimit
-#define SYS_setgid __NR_setgid
+#define SYS_getrusage __NR_getrusage
-#define SYS_bdflush __NR_bdflush
+#define SYS_getsid __NR_getsid
-#define SYS_statfs __NR_statfs
-#define SYS_mount __NR_mount
-#define SYS_sgetmask __NR_sgetmask
-#define SYS_idle __NR_idle
-#define SYS_sigaction __NR_sigaction
-#define SYS_wait4 __NR_wait4
-#define SYS_fork __NR_fork
-#define SYS_setfsuid __NR_setfsuid
-#define SYS_settimeofday __NR_settimeofday
-#define SYS_pwrite __NR_pwrite
-#define SYS_ssetmask __NR_ssetmask
-#define SYS_rt_sigpending __NR_rt_sigpending
-#define SYS_afs_syscall __NR_afs_syscall
-#define SYS_exit __NR_exit
-#define SYS_sysinfo __NR_sysinfo
 #define SYS_getsockname __NR_getsockname
 #define SYS_getsockname __NR_getsockname
-#define SYS_socket __NR_socket
+#define SYS_getsockopt __NR_getsockopt
-#define SYS_symlink __NR_symlink
+#define SYS_gettimeofday __NR_gettimeofday
+#define SYS_getuid __NR_getuid
+#define SYS_init_module __NR_init_module
 #define SYS_ioctl __NR_ioctl
 #define SYS_ioctl __NR_ioctl
-#define SYS_ftruncate __NR_ftruncate
+#define SYS_ipc __NR_ipc
-#define SYS_sched_getparam __NR_sched_getparam
-#define SYS_creat __NR_creat
-#define SYS_lchown __NR_lchown
-#define SYS_sched_rr_get_interval __NR_sched_rr_get_interval
-#define SYS_fcntl __NR_fcntl
-#define SYS_setsid __NR_setsid
-#define SYS_mprotect __NR_mprotect
-#define SYS_setuid __NR_setuid
-#define SYS_socketpair __NR_socketpair
-#define SYS_oldlstat __NR_oldlstat
-#define SYS_umask __NR_umask
 #define SYS_kill __NR_kill
 #define SYS_kill __NR_kill
-#define SYS_vfork __NR_vfork
+#define SYS_lchown __NR_lchown
-#define SYS_nanosleep __NR_nanosleep
-#define SYS_stime __NR_stime
-#define SYS_uname __NR_uname
-#define SYS_signal __NR_signal
-#define SYS_getitimer __NR_getitimer
-#define SYS_getdomainname __NR_getdomainname
-#define SYS_readv __NR_readv
-#define SYS_getcwd __NR_getcwd
-#define SYS_getpriority __NR_getpriority
-#define SYS_msync __NR_msync
 #define SYS_link __NR_link
 #define SYS_link __NR_link
-#define SYS_sched_setparam __NR_sched_setparam
+#define SYS_lseek __NR_lseek
-#define SYS_getgid __NR_getgid
+#define SYS_lstat __NR_lstat
-#define SYS__newselect __NR__newselect
+#define SYS_madvise __NR_madvise
-#define SYS_recvmsg __NR_recvmsg
+#define SYS_mincore __NR_mincore
-#define SYS_getrusage __NR_getrusage
+#define SYS_mkdir __NR_mkdir
-#define SYS_recvfrom __NR_recvfrom
+#define SYS_mknod __NR_mknod
-#define SYS__llseek __NR__llseek
+#define SYS_mlock __NR_mlock
-#define SYS_sched_yield __NR_sched_yield
+#define SYS_mlockall __NR_mlockall
-#define SYS_connect __NR_connect
-#define SYS_nice __NR_nice
 #define SYS_mmap __NR_mmap
 #define SYS_mmap __NR_mmap
-#define SYS_get_kernel_syms __NR_get_kernel_syms
+#define SYS_mount __NR_mount
-#define SYS_setgroups __NR_setgroups
+#define SYS_mprotect __NR_mprotect
+#define SYS_mremap __NR_mremap
+#define SYS_msync __NR_msync
+#define SYS_munlock __NR_munlock
+#define SYS_munlockall __NR_munlockall
 #define SYS_munmap __NR_munmap
 #define SYS_munmap __NR_munmap
-#define SYS_quotactl __NR_quotactl
+#define SYS_nanosleep __NR_nanosleep
-#define SYS_getrlimit __NR_getrlimit
+#define SYS_nfsservctl __NR_nfsservctl
+#define SYS_nice __NR_nice
+#define SYS_oldlstat __NR_oldlstat
+#define SYS_open __NR_open
+#define SYS_pause __NR_pause
+#define SYS_pciconfig_read __NR_pciconfig_read
+#define SYS_pciconfig_write __NR_pciconfig_write
 #define SYS_perfctr __NR_perfctr
 #define SYS_perfctr __NR_perfctr
-#define SYS_brk __NR_brk
-#define SYS_sched_getscheduler __NR_sched_getscheduler
 #define SYS_personality __NR_personality
 #define SYS_personality __NR_personality
-#define SYS_getpid __NR_getpid
-#define SYS_vhangup __NR_vhangup
-#define SYS_mremap __NR_mremap
-#define SYS_getpagesize __NR_getpagesize
-#define SYS_ptrace __NR_ptrace
-#define SYS_sendmsg __NR_sendmsg
-#define SYS_dup __NR_dup
-#define SYS_getsid __NR_getsid
-#define SYS_getegid __NR_getegid
-#define SYS_uselib __NR_uselib
-#define SYS_rt_sigprocmask __NR_rt_sigprocmask
-#define SYS_shutdown __NR_shutdown
-#define SYS_getuid __NR_getuid
-#define SYS_init_module __NR_init_module
-#define SYS_ipc __NR_ipc
-#define SYS_capget __NR_capget
 #define SYS_pipe __NR_pipe
 #define SYS_pipe __NR_pipe
-#define SYS_read __NR_read
+#define SYS_pivot_root __NR_pivot_root
-#define SYS_open __NR_open
-#define SYS_setdomainname __NR_setdomainname
-#define SYS_setregid __NR_setregid
-#define SYS_alarm __NR_alarm
-#define SYS_pread __NR_pread
 #define SYS_poll __NR_poll
 #define SYS_poll __NR_poll
-#define SYS_flock __NR_flock
-#define SYS_sigsuspend __NR_sigsuspend
-#define SYS_fdatasync __NR_fdatasync
 #define SYS_prctl __NR_prctl
 #define SYS_prctl __NR_prctl
-#define SYS_sysfs __NR_sysfs
+#define SYS_pread __NR_pread
-#define SYS_sethostname __NR_sethostname
+#define SYS_ptrace __NR_ptrace
-#define SYS_geteuid __NR_geteuid
+#define SYS_pwrite __NR_pwrite
-#define SYS_swapon __NR_swapon
+#define SYS_query_module __NR_query_module
-#define SYS_capset __NR_capset
+#define SYS_quotactl __NR_quotactl
-#define SYS_create_module __NR_create_module
+#define SYS_read __NR_read
-#define SYS_execve __NR_execve
+#define SYS_readdir __NR_readdir
-#define SYS_utime __NR_utime
+#define SYS_readlink __NR_readlink
+#define SYS_readv __NR_readv
 #define SYS_reboot __NR_reboot
 #define SYS_reboot __NR_reboot
-#define SYS_socketcall __NR_socketcall
+#define SYS_recvfrom __NR_recvfrom
-#define SYS_fchdir __NR_fchdir
+#define SYS_recvmsg __NR_recvmsg
-#define SYS_sendfile __NR_sendfile
+#define SYS_rename __NR_rename
-#define SYS_time __NR_time
-#define SYS_setreuid __NR_setreuid
-#define SYS_getpeername __NR_getpeername
-#define SYS_select __NR_select
-#define SYS_ustat __NR_ustat
-#define SYS_mkdir __NR_mkdir
 #define SYS_rmdir __NR_rmdir
 #define SYS_rmdir __NR_rmdir
-#define SYS_adjtimex __NR_adjtimex
+#define SYS_rt_sigaction __NR_rt_sigaction
-#define SYS_acct __NR_acct
+#define SYS_rt_sigpending __NR_rt_sigpending
+#define SYS_rt_sigprocmask __NR_rt_sigprocmask
+#define SYS_rt_sigqueueinfo __NR_rt_sigqueueinfo
+#define SYS_rt_sigreturn __NR_rt_sigreturn
+#define SYS_rt_sigsuspend __NR_rt_sigsuspend
+#define SYS_rt_sigtimedwait __NR_rt_sigtimedwait
+#define SYS_sched_get_priority_max __NR_sched_get_priority_max
+#define SYS_sched_get_priority_min __NR_sched_get_priority_min
+#define SYS_sched_getparam __NR_sched_getparam
+#define SYS_sched_getscheduler __NR_sched_getscheduler
+#define SYS_sched_rr_get_interval __NR_sched_rr_get_interval
+#define SYS_sched_setparam __NR_sched_setparam
 #define SYS_sched_setscheduler __NR_sched_setscheduler
 #define SYS_sched_setscheduler __NR_sched_setscheduler
-#define SYS_mlockall __NR_mlockall
+#define SYS_sched_yield __NR_sched_yield
-#define SYS_fstatfs __NR_fstatfs
+#define SYS_select __NR_select
-#define SYS_stat __NR_stat
+#define SYS_sendfile __NR_sendfile
-#define SYS_pciconfig_read __NR_pciconfig_read
+#define SYS_sendmsg __NR_sendmsg
+#define SYS_sendto __NR_sendto
+#define SYS_setdomainname __NR_setdomainname
+#define SYS_setfsgid __NR_setfsgid
+#define SYS_setfsuid __NR_setfsuid
+#define SYS_setgid __NR_setgid
+#define SYS_setgroups __NR_setgroups
+#define SYS_sethostname __NR_sethostname
+#define SYS_setitimer __NR_setitimer
+#define SYS_setpgid __NR_setpgid
+#define SYS_setpriority __NR_setpriority
+#define SYS_setregid __NR_setregid
+#define SYS_setreuid __NR_setreuid
+#define SYS_setrlimit __NR_setrlimit
+#define SYS_setsid __NR_setsid
+#define SYS_settimeofday __NR_settimeofday
+#define SYS_setuid __NR_setuid
+#define SYS_sgetmask __NR_sgetmask
+#define SYS_shutdown __NR_shutdown
+#define SYS_sigaction __NR_sigaction
+#define SYS_sigaltstack __NR_sigaltstack
+#define SYS_signal __NR_signal
 #define SYS_sigpending __NR_sigpending
 #define SYS_sigpending __NR_sigpending
-#define SYS_chdir __NR_chdir
+#define SYS_sigprocmask __NR_sigprocmask
+#define SYS_sigreturn __NR_sigreturn
+#define SYS_sigsuspend __NR_sigsuspend
+#define SYS_socket __NR_socket
+#define SYS_socketcall __NR_socketcall
+#define SYS_socketpair __NR_socketpair
+#define SYS_ssetmask __NR_ssetmask
+#define SYS_stat __NR_stat
+#define SYS_statfs __NR_statfs
+#define SYS_stime __NR_stime
 #define SYS_swapoff __NR_swapoff
 #define SYS_swapoff __NR_swapoff
-#define SYS_rt_sigtimedwait __NR_rt_sigtimedwait
+#define SYS_swapon __NR_swapon
-#define SYS_rt_sigqueueinfo __NR_rt_sigqueueinfo
+#define SYS_symlink __NR_symlink
-#define SYS_syslog __NR_syslog
-#define SYS_fchmod __NR_fchmod
-#define SYS_nfsservctl __NR_nfsservctl
-#define SYS_readlink __NR_readlink
-#define SYS_munlockall __NR_munlockall
-#define SYS_accept __NR_accept
-#define SYS_sendto __NR_sendto
 #define SYS_sync __NR_sync
 #define SYS_sync __NR_sync
-#define SYS_setitimer __NR_setitimer
+#define SYS_sysfs __NR_sysfs
-#define SYS_fchown __NR_fchown
+#define SYS_sysinfo __NR_sysinfo
-#define SYS_access __NR_access
+#define SYS_syslog __NR_syslog
-#define SYS_aplib __NR_aplib
+#define SYS_times __NR_times
-#define SYS_sched_get_priority_max __NR_sched_get_priority_max
+#define SYS_truncate __NR_truncate
-#define SYS_gettimeofday __NR_gettimeofday
+#define SYS_umask __NR_umask
-#define SYS_mknod __NR_mknod
+#define SYS_umount __NR_umount
-#define SYS_execv __NR_execv
+#define SYS_umount2 __NR_umount2
-#define SYS_utimes __NR_utimes
+#define SYS_uname __NR_uname
-#define SYS_sched_get_priority_min __NR_sched_get_priority_min
-#define SYS_getgroups __NR_getgroups
-#define SYS_chmod __NR_chmod
-#define SYS_mlock __NR_mlock
 #define SYS_unlink __NR_unlink
 #define SYS_unlink __NR_unlink
-#define SYS__sysctl __NR__sysctl
+#define SYS_uselib __NR_uselib
-#define SYS_sigprocmask __NR_sigprocmask
+#define SYS_ustat __NR_ustat
-#define SYS_rt_sigreturn __NR_rt_sigreturn
+#define SYS_utime __NR_utime
-#define SYS_lseek __NR_lseek
+#define SYS_utimes __NR_utimes
-#define SYS_setpriority __NR_setpriority
+#define SYS_vfork __NR_vfork
-#define SYS_pciconfig_write __NR_pciconfig_write
+#define SYS_vhangup __NR_vhangup
-#define SYS_chown __NR_chown
+#define SYS_wait4 __NR_wait4
+#define SYS_waitpid __NR_waitpid
+#define SYS_write __NR_write
+#define SYS_writev __NR_writev
+#if __WORDSIZE == 64
+#define SYS_getresgid __NR_getresgid
+#define SYS_getresuid __NR_getresuid
+#define SYS_memory_ordering __NR_memory_ordering
+#define SYS_setresgid __NR_setresgid
+#define SYS_setresuid __NR_setresuid
+#define SYS_utrap_install __NR_utrap_install
+#else
+#define SYS_chown32 __NR_chown32
+#define SYS_fchown32 __NR_fchown32
+#define SYS_fcntl64 __NR_fcntl64
+#define SYS_fstat64 __NR_fstat64
+#define SYS_ftruncate64 __NR_ftruncate64
+#define SYS_getegid32 __NR_getegid32
+#define SYS_geteuid32 __NR_geteuid32
+#define SYS_getgid32 __NR_getgid32
+#define SYS_getgroups32 __NR_getgroups32
+#define SYS_getresgid32 __NR_getresgid32
+#define SYS_getresuid32 __NR_getresuid32
+#define SYS_getuid32 __NR_getuid32
+#define SYS_lchown32 __NR_lchown32
+#define SYS_lstat64 __NR_lstat64
+#define SYS_mmap2 __NR_mmap2
+#define SYS_setfsgid32 __NR_setfsgid32
+#define SYS_setfsuid32 __NR_setfsuid32
+#define SYS_setgid32 __NR_setgid32
+#define SYS_setgroups32 __NR_setgroups32
+#define SYS_setregid32 __NR_setregid32
+#define SYS_setresgid32 __NR_setresgid32
+#define SYS_setresuid32 __NR_setresuid32
+#define SYS_setreuid32 __NR_setreuid32
+#define SYS_setuid32 __NR_setuid32
+#define SYS_stat64 __NR_stat64
+#define SYS_time __NR_time
+#define SYS_truncate64 __NR_truncate64
+#endif

+ 9 - 8
libc/sysdeps/linux/sparc/bits/termios.h

@@ -3,19 +3,19 @@
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #ifndef _TERMIOS_H
 #ifndef _TERMIOS_H
 # error "Never include <bits/termios.h> directly; use <termios.h> instead."
 # error "Never include <bits/termios.h> directly; use <termios.h> instead."
@@ -156,6 +156,7 @@ struct termios
 #define B1152000 0x0000100d
 #define B1152000 0x0000100d
 #define B1500000 0x0000100e
 #define B1500000 0x0000100e
 #define B2000000 0x0000100f
 #define B2000000 0x0000100f
+#define __MAX_BAUD B2000000
 
 
 #define CIBAUD	0x100f0000	/* input baud rate (not used) */
 #define CIBAUD	0x100f0000	/* input baud rate (not used) */
 #define CMSPAR	0x40000000	/* mark or space (stick) parity */
 #define CMSPAR	0x40000000	/* mark or space (stick) parity */

+ 30 - 16
libc/sysdeps/linux/sparc/bits/time.h

@@ -1,21 +1,21 @@
-/* System-dependent timing definitions.  Linux version.
+/* System-dependent timing definitions.  Linux/SPARC version.
-   Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 /*
 /*
  * Never include this file directly; use <time.h> instead.
  * Never include this file directly; use <time.h> instead.
@@ -31,18 +31,32 @@
 /* CAE XSH, Issue 4, Version 2: <time.h>
 /* CAE XSH, Issue 4, Version 2: <time.h>
    The value of CLOCKS_PER_SEC is required to be 1 million on all
    The value of CLOCKS_PER_SEC is required to be 1 million on all
    XSI-conformant systems. */
    XSI-conformant systems. */
-#  define CLOCKS_PER_SEC  1000000
+#  define CLOCKS_PER_SEC  1000000l
 
 
-#  ifndef __STRICT_ANSI__
+#  if !defined __STRICT_ANSI__ && !defined __USE_XOPEN2K
 /* Even though CLOCKS_PER_SEC has such a strange value CLK_TCK
 /* Even though CLOCKS_PER_SEC has such a strange value CLK_TCK
    presents the real value for clock ticks per second for the system.  */
    presents the real value for clock ticks per second for the system.  */
-#   define CLK_TCK 100
+#   include <bits/types.h>
+extern long int __sysconf (int);
+#   define CLK_TCK ((__clock_t) __sysconf (2))	/* 2 is _SC_CLK_TCK */
+#  endif
+
+#  ifdef __USE_POSIX199309
+/* Identifier for system-wide realtime clock.  */
+#   define CLOCK_REALTIME		0
+/* High-resolution timer from the CPU.  */
+#   define CLOCK_PROCESS_CPUTIME_ID	2
+/* Thread-specific CPU-time clock.  */
+#   define CLOCK_THREAD_CPUTIME_ID	3
+
+/* Flag to indicate time is absolute.  */
+#   define TIMER_ABSTIME		1
 #  endif
 #  endif
 
 
 # endif	/* bits/time.h */
 # endif	/* bits/time.h */
 #endif
 #endif
 
 
-#ifdef __need_timeval 
+#ifdef __need_timeval
 # undef __need_timeval
 # undef __need_timeval
 # ifndef _STRUCT_TIMEVAL
 # ifndef _STRUCT_TIMEVAL
 #  define _STRUCT_TIMEVAL	1
 #  define _STRUCT_TIMEVAL	1
@@ -53,7 +67,7 @@
 struct timeval
 struct timeval
   {
   {
     __time_t tv_sec;		/* Seconds.  */
     __time_t tv_sec;		/* Seconds.  */
-    __time_t tv_usec;		/* Microseconds.  */
+    __suseconds_t tv_usec;	/* Microseconds.  */
   };
   };
 # endif	/* struct timeval */
 # endif	/* struct timeval */
-#endif	/* need timeval */ 
+#endif	/* need timeval */

+ 25 - 38
libc/sysdeps/linux/sparc/bits/types.h

@@ -1,20 +1,20 @@
-/* Copyright (C) 1991,92,94,95,96,97,98,99 Free Software Foundation, Inc.
+/* Copyright (C) 1991,92,1994-1999,2000,2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 /*
 /*
  * Never include this file directly; use <sys/types.h> instead.
  * Never include this file directly; use <sys/types.h> instead.
@@ -73,7 +73,7 @@ typedef __u_quad_t __dev_t;		/* Type of device numbers.  */
 typedef __u_int __uid_t;		/* Type of user identifications.  */
 typedef __u_int __uid_t;		/* Type of user identifications.  */
 typedef __u_int __gid_t;		/* Type of group identifications.  */
 typedef __u_int __gid_t;		/* Type of group identifications.  */
 typedef __u_long __ino_t;		/* Type of file serial numbers.  */
 typedef __u_long __ino_t;		/* Type of file serial numbers.  */
-typedef __u_long __ino64_t;		/* Type of file serial numbers.  */
+typedef __u_quad_t __ino64_t;		/* Type of file serial numbers.  */
 typedef __u_int __mode_t;		/* Type of file attribute bitmasks.  */
 typedef __u_int __mode_t;		/* Type of file attribute bitmasks.  */
 typedef __u_int __nlink_t; 		/* Type of file link counts.  */
 typedef __u_int __nlink_t; 		/* Type of file link counts.  */
 typedef long int __off_t;		/* Type of file sizes and offsets.  */
 typedef long int __off_t;		/* Type of file sizes and offsets.  */
@@ -81,7 +81,7 @@ typedef __quad_t  __off64_t;		/*  "" (LFS) */
 typedef __quad_t __loff_t;		/* Type of file sizes and offsets.  */
 typedef __quad_t __loff_t;		/* Type of file sizes and offsets.  */
 typedef int __pid_t;			/* Type of process identifications.  */
 typedef int __pid_t;			/* Type of process identifications.  */
 #if __WORDSIZE == 64
 #if __WORDSIZE == 64
-typedef long long int __ssize_t;	/* Type of a byte count, or error.  */
+typedef long int __ssize_t;		/* Type of a byte count, or error.  */
 #else
 #else
 typedef int __ssize_t;			/* Type of a byte count, or error.  */
 typedef int __ssize_t;			/* Type of a byte count, or error.  */
 #endif
 #endif
@@ -98,51 +98,35 @@ typedef struct
 typedef int __daddr_t;			/* The type of a disk address.  */
 typedef int __daddr_t;			/* The type of a disk address.  */
 typedef char *__caddr_t;
 typedef char *__caddr_t;
 typedef long int __time_t;
 typedef long int __time_t;
+typedef unsigned int __useconds_t;
+typedef int __suseconds_t;
 typedef long int __swblk_t;		/* Type of a swap block maybe?  */
 typedef long int __swblk_t;		/* Type of a swap block maybe?  */
 
 
 typedef long int __clock_t;
 typedef long int __clock_t;
 
 
-/* One element in the file descriptor mask array.  */
+/* Clock ID used in clock and timer functions.  */
-typedef unsigned long int __fd_mask;
+typedef int __clockid_t;
 
 
-/* Due to incaution, we may have gotten these from a kernel header file.  */
+/* Timer ID returned by `timer_create'.  */
-#undef __FD_SETSIZE
+typedef int __timer_t;
-#undef __NFDBITS
-#undef __FDMASK
 
 
 /* Number of descriptors that can fit in an `fd_set'.  */
 /* Number of descriptors that can fit in an `fd_set'.  */
 #define __FD_SETSIZE	1024
 #define __FD_SETSIZE	1024
 
 
-/* It's easier to assume 8-bit bytes than to get CHAR_BIT.  */
-#define __NFDBITS	(8 * sizeof (__fd_mask))
-#define	__FDELT(d)	((d) / __NFDBITS)
-#define	__FDMASK(d)	((__fd_mask) 1 << ((d) % __NFDBITS))
-
-/* fd_set for select and pselect.  */
-typedef struct
-  {
-    /* XPG4.2 requires this member name.  Otherwise avoid the name
-       from the user namespace.  */
-#ifdef __USE_XOPEN
-    __fd_mask fds_bits[__FD_SETSIZE / __NFDBITS];
-# define __FDS_BITS(set) ((set)->fds_bits)
-#else
-    __fd_mask __fds_bits[__FD_SETSIZE / __NFDBITS];
-# define __FDS_BITS(set) ((set)->__fds_bits)
-#endif
-  } __fd_set;
-
 
 
 typedef int __key_t;
 typedef int __key_t;
 
 
 /* Used in `struct shmid_ds'.  */
 /* Used in `struct shmid_ds'.  */
 #if __WORDSIZE == 64
 #if __WORDSIZE == 64
-typedef int               __ipc_pid_t;
+typedef int		   __ipc_pid_t;
 #else
 #else
 typedef unsigned short int __ipc_pid_t;
 typedef unsigned short int __ipc_pid_t;
 #endif
 #endif
 
 
 
 
+/* Type to represent block size.  */
+typedef long int __blksize_t;
+
 /* Types from the Large File Support interface.  */
 /* Types from the Large File Support interface.  */
 
 
 /* Type to count number os disk blocks.  */
 /* Type to count number os disk blocks.  */
@@ -168,9 +152,12 @@ typedef long int __intptr_t;
 typedef int      __intptr_t;
 typedef int      __intptr_t;
 #endif
 #endif
 
 
+/* Duplicate info from sys/socket.h.  */
+typedef unsigned int __socklen_t;
+
 
 
 /* Now add the thread types.  */
 /* Now add the thread types.  */
-#ifdef __USE_UNIX98
+#if defined __USE_POSIX199506 || defined __USE_UNIX98
 # include <bits/pthreadtypes.h>
 # include <bits/pthreadtypes.h>
 #endif
 #endif
 
 

+ 8 - 8
libc/sysdeps/linux/sparc/bits/uio.h

@@ -2,19 +2,19 @@
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #ifndef _SYS_UIO_H
 #ifndef _SYS_UIO_H
 # error "Never include <bits/uio.h> directly; use <sys/uio.h> instead."
 # error "Never include <bits/uio.h> directly; use <sys/uio.h> instead."

+ 8 - 8
libc/sysdeps/linux/sparc/bits/ustat.h

@@ -2,19 +2,19 @@
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #include <sys/types.h>
 #include <sys/types.h>
 
 

+ 9 - 8
libc/sysdeps/linux/sparc/bits/utmp.h

@@ -1,20 +1,21 @@
 /* The `struct utmp' type, describing entries in the utmp file.  GNU version.
 /* The `struct utmp' type, describing entries in the utmp file.  GNU version.
    Copyright (C) 1993, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
    Copyright (C) 1993, 1996, 1997, 1998, 1999 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
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #ifndef _UTMP_H
 #ifndef _UTMP_H
 # error "Never include <bits/utmp.h> directly; use <utmp.h> instead."
 # error "Never include <bits/utmp.h> directly; use <utmp.h> instead."

+ 14 - 11
libc/sysdeps/linux/sparc/bits/utmpx.h

@@ -1,20 +1,21 @@
-/* Structures and defenitions for the user accounting database.  GNU version.
+/* Structures and definitions for the user accounting database.  GNU version.
-   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998, 2000, 2001 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
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #ifndef _UTMPX_H
 #ifndef _UTMPX_H
 # error "Never include <bits/utmpx.h> directly; use <utmpx.h> instead."
 # error "Never include <bits/utmpx.h> directly; use <utmpx.h> instead."
@@ -71,7 +72,9 @@ struct utmpx
 /* Values for the `ut_type' field of a `struct utmpx'.  */
 /* Values for the `ut_type' field of a `struct utmpx'.  */
 #define EMPTY		0	/* No valid user accounting information.  */
 #define EMPTY		0	/* No valid user accounting information.  */
 
 
-#define RUN_LVL		1	/* The system's runlevel.  */
+#ifdef __USE_GNU
+# define RUN_LVL	1	/* The system's runlevel.  */
+#endif
 #define BOOT_TIME	2	/* Time of system boot.  */
 #define BOOT_TIME	2	/* Time of system boot.  */
 #define NEW_TIME	3	/* Time after system clock changed.  */
 #define NEW_TIME	3	/* Time after system clock changed.  */
 #define OLD_TIME	4	/* Time when system clock changed.  */
 #define OLD_TIME	4	/* Time when system clock changed.  */

+ 8 - 8
libc/sysdeps/linux/sparc/bits/utsname.h

@@ -2,19 +2,19 @@
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #ifndef _SYS_UTSNAME_H
 #ifndef _SYS_UTSNAME_H
 # error "Never include <bits/utsname.h> directly; use <sys/utsname.h> instead."
 # error "Never include <bits/utsname.h> directly; use <sys/utsname.h> instead."

+ 9 - 9
libc/sysdeps/linux/sparc/bits/waitflags.h

@@ -3,21 +3,21 @@
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
-#ifndef _SYS_WAIT_H
+#if !defined _SYS_WAIT_H && !defined _STDLIB_H
 # error "Never include <bits/waitflags.h> directly; use <sys/wait.h> instead."
 # error "Never include <bits/waitflags.h> directly; use <sys/wait.h> instead."
 #endif
 #endif
 
 

+ 10 - 10
libc/sysdeps/linux/sparc/bits/waitstatus.h

@@ -1,23 +1,23 @@
 /* Definitions of status bits for `wait' et al.
 /* Definitions of status bits for `wait' et al.
-   Copyright (C) 1992, 1994, 1996, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1992, 1994, 1996, 1997, 2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
-#ifndef _SYS_WAIT_H
+#if !defined _SYS_WAIT_H && !defined _STDLIB_H
 # error "Never include <bits/waitstatus.h> directly; use <sys/wait.h> instead."
 # error "Never include <bits/waitstatus.h> directly; use <sys/wait.h> instead."
 #endif
 #endif
 
 

+ 6 - 18
libc/sysdeps/linux/sparc/bits/wordsize.h

@@ -1,19 +1,7 @@
-/* Copyright (C) 1999 Free Software Foundation, Inc.
+/* Determine the wordsize from the preprocessor defines.  */
-   This file is part of the GNU C Library.
 
 
-   The GNU C Library is free software; you can redistribute it and/or
+#if defined __arch64__ || defined __sparcv9
-   modify it under the terms of the GNU Library General Public License as
+# define __WORDSIZE	64
-   published by the Free Software Foundation; either version 2 of the
+#else
-   License, or (at your option) any later version.
+# define __WORDSIZE	32
-
+#endif
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
-
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
-
-#define __WORDSIZE	32

+ 67 - 19
libc/sysdeps/linux/sparc/bits/xopen_lim.h

@@ -1,20 +1,20 @@
-/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1999, 2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   version 2.1 of the License, or (at your option) any later version.
 
 
    The GNU C Library is distributed in the hope that it will be useful,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
 
-   You should have received a copy of the GNU Library General Public
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 /*
 /*
  * Never include this file directly; use <limits.h> instead.
  * Never include this file directly; use <limits.h> instead.
@@ -30,7 +30,7 @@
 #ifndef _XOPEN_LIM_H
 #ifndef _XOPEN_LIM_H
 #define _XOPEN_LIM_H	1
 #define _XOPEN_LIM_H	1
 
 
-#define __need_FOPEN_MAX
+#define __need_IOV_MAX
 #include <bits/stdio_lim.h>
 #include <bits/stdio_lim.h>
 
 
 /* We do not provide fixed values for
 /* We do not provide fixed values for
@@ -51,18 +51,14 @@
    PAGE_SIZE	Size of bytes of a page.
    PAGE_SIZE	Size of bytes of a page.
 
 
    PASS_MAX	Maximum number of significant bytes in a password.
    PASS_MAX	Maximum number of significant bytes in a password.
-*/
-
 
 
-/* Maximum number of `iovec' structures that one process has available
+   We only provide a fixed limit for
-   for use with `readv' or writev'.  */
-#define IOV_MAX		_XOPEN_IOV_MAX
 
 
-/* The number of streams that one process can have open at one time.  */
+   IOV_MAX	Maximum number of `iovec' structures that one process has
-#define STREAM_MAX	FOPEN_MAX
+		available for use with `readv' or writev'.
 
 
-/* Maximum number of bytes supported for the name of a time zone.  */
+   if this is indeed fixed by the underlying system.
-#define TZNAME_MAX	_POSIX_TZNAME_MAX
+*/
 
 
 
 
 /* Maximum number of `iovec' structures that one process has available
 /* Maximum number of `iovec' structures that one process has available
@@ -93,4 +89,56 @@
 /* Default process priority.  */
 /* Default process priority.  */
 #define NZERO		20
 #define NZERO		20
 
 
+
+/* Number of bits in a word of type `int'.  */
+#ifdef INT_MAX
+# if INT_MAX == 32767
+#  define WORD_BIT	16
+# else
+#  if INT_MAX == 2147483647
+#   define WORD_BIT	32
+#  else
+/* Safe assumption.  */
+#   define WORD_BIT	64
+#  endif
+# endif
+#elif defined __INT_MAX__
+# if __INT_MAX__ == 32767
+#  define WORD_BIT	16
+# else
+#  if __INT_MAX__ == 2147483647
+#   define WORD_BIT	32
+#  else
+/* Safe assumption.  */
+#   define WORD_BIT	64
+#  endif
+# endif
+#else
+# define WORD_BIT	32
+#endif
+
+/* Number of bits in a word of type `long int'.  */
+#ifdef LONG_MAX
+# if LONG_MAX == 2147483647
+#  define LONG_BIT	32
+# else
+/* Safe assumption.  */
+#  define LONG_BIT	64
+# endif
+#elif defined __LONG_MAX__
+# if __LONG_MAX__ == 2147483647
+#  define LONG_BIT	32
+# else
+/* Safe assumption.  */
+#  define LONG_BIT	64
+# endif
+#else
+# include <bits/wordsize.h>
+# if __WORDSIZE == 64
+#  define LONG_BIT	64
+# else
+#  define LONG_BIT	32
+# endif
+#endif
+
 #endif /* bits/xopen_lim.h */
 #endif /* bits/xopen_lim.h */