about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1997-12-28 16:01:53 +0000
committerUlrich Drepper <drepper@redhat.com>1997-12-28 16:01:53 +0000
commitb9b49b44fdc1c74ad85076bca9ff7ea0200e2214 (patch)
tree9fb0945b8576709212f84f3bbc6bd051e36b36af /sysdeps
parent9756dfe161e523a5d543fb2b1f33a7e682a36342 (diff)
downloadglibc-b9b49b44fdc1c74ad85076bca9ff7ea0200e2214.tar.gz
glibc-b9b49b44fdc1c74ad85076bca9ff7ea0200e2214.tar.xz
glibc-b9b49b44fdc1c74ad85076bca9ff7ea0200e2214.zip
1997-12-28 15:08  Ulrich Drepper  <drepper@cygnus.com>

	* sysdeps/powerpc/__longjmp.S: Define _SETJMP_H before including
	<bits/setjmp.h>.
	* sysdeps/powerpc/setjmp.S: Likewise.
	Patches by Matt McLean <keys@keys.got.net>.

	* Make-dist (sysdep_dirs): Ignore bits dirs while searching.

	* Makefile: Undo last patch.
	(distribute): Add test-installation.pl.

	* configure.in: Correct handling of --enable-add-ons without parameter.
	Correct address of WWW pages.

	* libc.map: Add _nl_domain_bindings.

	* db2/mutex/tsl_parisc.s: New file.

	* iconvdata/Makefile (distribute): Add jis0201.c, jis0208.c, jis0212.c,
	and extra-module.mk.

	* localedata/Makefile (distribute): New.  Add all the files.

	* stdlib/Makefile (headers): Add inttypes.h.
	(routines): Add strtoimax, strtoumax, wcstoimax, and wcstoumax.
	* sysdeps/generic/inttypes.h: New file.
	* sysdeps/generic/strtoimax.c: New file.
	* sysdeps/generic/strtoumax.c: New file.
	* sysdeps/generic/wcstoimax.c: New file.
	* sysdeps/generic/wcstoumax.c: New file.
	* sysdeps/wordsize-32/Dist: Removed.
	* sysdeps/wordsize-32/Makefile: Removed.
	* sysdeps/wordsize-64/Dist: Removed.
	* sysdeps/wordsize-64/Makefile: Removed.
	* sysdeps/generic/bits/environments.h: New file.

	* include/limits.h: Define MB_LEN_MAX in any case to 6.  The gcc
	header is still not correct.

	* io/fcntl.h [__USE_FILE_OFFSET64]: We have to use the __*64 types.
	* posix/unistd.h: Likewise.
	* sysdeps/generic/sys/mman.h: Likewise.
	* sysdeps/unix/sysv/linux/sys/mman.h: Likewise.

	* manual/arith.texi: Change definition of mul macro.
	* manual/math.texi: Likewise.

	* misc/Makefile (routines): Add mmap64.
	* sysdeps/generic/mmap64.c: New file.
	* sysdeps/unix/sysv/linux/alpha/mmap64.c: New file.
	* sysdeps/unix/sysv/linux/sparc/sparc64/mmap64.c: New file.
	* sysdeps/unix/sysv/linux/alpha/syscalls.list: Add __mmap64 and mmap64
	aliases to mmap.
	* sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list: Likewise.

	* sysdeps/generic/setrlimit64.c: Don't mark as stub.

	* nis/nss_nis/nis-hosts.c (internal_nis_gethostent_r): Pretty print.

	* nis(rpcsvc/nis_tags.h: Prevent warning by unknown pragma.

	* sysdeps/posix/mk-stdiolim.c: Generate correct file which defines
	FOPEN_MAX also when included by limits.h.
	* sysdeps/unix/sysv/linux/stdio_lim.h.in: Likewise.

	* sysdeps/unix/sysv/linux/Dist: Add oldsiglist.c, netax25/ax25.h,
	and netrom/netrom.h.
	* sysdeps/unix/sysv/linux/Makefile [$(subdir)=stdio-common]: Add
	oldsiglist to sysdep_routines, not aux.
	[$(subdir)=inet] (sysdep_headers): Add netax25/ax25.h, netrom/netrom.h.

	* sysdeps/unix/sysv/linux/bits/socket.h: Remove SOL_AX25, SOL_ATALK,
	and SOL_NETROM definition.

	* sysdeps/unix/sysv/linux/i386/Dist: Add s_pwrite64.S and s_pread64.S.

	* sysdeps/unix/sysv/linux/net/route.h: Pretty print.
	* sysdeps/unix/sysv/linux/netatalk/at.h: Pretty print.

1997-12-25  Ulrich Drepper  <drepper@cygnus.com>

	* sysdeps/unix/sysv/linux/alpha/net/route.h: New file.

	* sysdeps/unix/sysv/linux/alpha/kernel_sigaction.h: Replace
	sa_handler with k_sa_handler.
	* sysdeps/unix/sysv/linux/alpha/syscalls.list: Add __getrlimit as
	strong alias.
	Reported by a sun.

	* sysdeps/unix/sysv/linux/sigsuspend.c: Don't define
	__libc_have_rt_sigs here.
	* sysdeps/unix/sysv/linux/sigaction.c: Do it instead here.
	* sysdeps/unix/sysv/linux/i386/sigaction.c: Likewise.
	* sysdeps/unix/sysv/linux/sigpending.c: Correct comment.
	* sysdeps/unix/sysv/linux/sigprocmask.c: Likewise.

1997-12-11 07:51  Geoff Keating  <geoffk@ozemail.com.au>

	* sysdeps/powerpc/atomicity.h: New file.
	* sysdeps/mach/powerpc/machine-lock.h: New file.

	* Rules: Use -fpic to build anything that might end up in a users'
	shared library.

	* sysdeps/powerpc/s_fdim.c: New file.
	* sysdeps/powerpc/s_fdimf.c: New file.
	* sysdeps/powerpc/s_fmax.S: New file.
	* sysdeps/powerpc/s_fmaxf.S: New file.
	* sysdeps/powerpc/s_fmin.S: New file.
	* sysdeps/powerpc/s_fminf.S: New file.
	* sysdeps/powerpc/s_llrint.c: Now is for double.
	* sysdeps/powerpc/s_llrintf.c: New file.
	* sysdeps/powerpc/s_llround.c: Now is for double.
	* sysdeps/powerpc/s_llroundf.c: New file.
	* sysdeps/powerpc/s_lrint.c: Now is for double.
	* sysdeps/powerpc/s_lrintf.S: New file.
	* sysdeps/powerpc/s_lround.c: Now is for double.
	* sysdeps/powerpc/s_lroundf.c: New file.
	* sysdeps/powerpc/bits/mathinlines.h: Add inline versions of lrint,
	lrintf, fdim, fdimf.

	* sysdeps/unix/sysv/linux/powerpc/kernel_termios.h: Don't use bits/
	file directly, use its parent.

	* sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c: Re-instate '++'
	(for the third time).

1997-12-20 13:50  Richard Henderson  <rth@cygnus.com>

	* posix/sched.h: timespec is in <time.h>.

	* sysdeps/unix/sysv/linux/sys/kd.h: Don't redefine _LINUX_TYPES_H.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/generic/bits/environments.h35
-rw-r--r--sysdeps/generic/inttypes.h1
-rw-r--r--sysdeps/generic/mmap64.c48
-rw-r--r--sysdeps/generic/setrlimit64.c1
-rw-r--r--sysdeps/generic/strtoimax.c1
-rw-r--r--sysdeps/generic/strtoumax.c1
-rw-r--r--sysdeps/generic/sys/mman.h2
-rw-r--r--sysdeps/generic/wcstoimax.c1
-rw-r--r--sysdeps/generic/wcstoumax.c1
-rw-r--r--sysdeps/mach/powerpc/machine-lock.h75
-rw-r--r--sysdeps/posix/mk-stdiolim.c4
-rw-r--r--sysdeps/powerpc/__longjmp.S1
-rw-r--r--sysdeps/powerpc/atomicity.h99
-rw-r--r--sysdeps/powerpc/bits/mathinline.h67
-rw-r--r--sysdeps/powerpc/s_fdim.c31
-rw-r--r--sysdeps/powerpc/s_fdimf.c27
-rw-r--r--sysdeps/powerpc/s_fmax.S43
-rw-r--r--sysdeps/powerpc/s_fmaxf.S1
-rw-r--r--sysdeps/powerpc/s_fmin.S43
-rw-r--r--sysdeps/powerpc/s_fminf.S1
-rw-r--r--sysdeps/powerpc/s_llrint.c11
-rw-r--r--sysdeps/powerpc/s_llrintf.c27
-rw-r--r--sysdeps/powerpc/s_llround.c12
-rw-r--r--sysdeps/powerpc/s_llroundf.c46
-rw-r--r--sysdeps/powerpc/s_lrint.c28
-rw-r--r--sysdeps/powerpc/s_lrintf.S1
-rw-r--r--sysdeps/powerpc/s_lround.c12
-rw-r--r--sysdeps/powerpc/s_lroundf.c46
-rw-r--r--sysdeps/powerpc/setjmp.S1
-rw-r--r--sysdeps/unix/sysv/linux/Dist3
-rw-r--r--sysdeps/unix/sysv/linux/Makefile4
-rw-r--r--sysdeps/unix/sysv/linux/alpha/kernel_sigaction.h2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/mmap64.c1
-rw-r--r--sysdeps/unix/sysv/linux/alpha/net/route.h140
-rw-r--r--sysdeps/unix/sysv/linux/alpha/syscalls.list4
-rw-r--r--sysdeps/unix/sysv/linux/bits/socket.h3
-rw-r--r--sysdeps/unix/sysv/linux/i386/Dist2
-rw-r--r--sysdeps/unix/sysv/linux/i386/sigaction.c4
-rw-r--r--sysdeps/unix/sysv/linux/net/route.h3
-rw-r--r--sysdeps/unix/sysv/linux/netatalk/at.h6
-rw-r--r--sysdeps/unix/sysv/linux/netax25/ax25.h147
-rw-r--r--sysdeps/unix/sysv/linux/netrom/netrom.h80
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c7
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/kernel_termios.h2
-rw-r--r--sysdeps/unix/sysv/linux/sigaction.c4
-rw-r--r--sysdeps/unix/sysv/linux/sigpending.c2
-rw-r--r--sysdeps/unix/sysv/linux/sigprocmask.c2
-rw-r--r--sysdeps/unix/sysv/linux/sigsuspend.c4
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/mmap64.c1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list1
-rw-r--r--sysdeps/unix/sysv/linux/stdio_lim.h.in5
-rw-r--r--sysdeps/unix/sysv/linux/sys/kd.h4
-rw-r--r--sysdeps/unix/sysv/linux/sys/mman.h10
-rw-r--r--sysdeps/wordsize-32/Dist5
-rw-r--r--sysdeps/wordsize-32/Makefile5
-rw-r--r--sysdeps/wordsize-64/Dist5
-rw-r--r--sysdeps/wordsize-64/Makefile5
57 files changed, 1034 insertions, 94 deletions
diff --git a/sysdeps/generic/bits/environments.h b/sysdeps/generic/bits/environments.h
new file mode 100644
index 0000000000..8ed19906b4
--- /dev/null
+++ b/sysdeps/generic/bits/environments.h
@@ -0,0 +1,35 @@
+/* Copyright (C) 1997 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
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   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.  */
+
+#ifndef _UNISTD_H
+# error "Never include this file directly.  Use <unistd.h> instead"
+#endif
+
+/* This header should define the following symbols under the described
+   situations.  A value `1' means that the model is always supported,
+   `-1' means it is never supported.  Undefined means it cannot be
+   statically decided.
+
+   _XBS5_ILP32_OFF32	32bit int, long, pointers, and off_t type
+   _XBS5_ILP32_OFFBIG	32bit int, long, and pointers and larger off_t type
+
+   _XBS5_LP64_OFF32	64bit long and pointers and 32bit off_t type
+   _XBS5_LPBIG_OFFBIG	64bit long and pointers and large off_t type
+*/
+
+#endif /* environments.h */
diff --git a/sysdeps/generic/inttypes.h b/sysdeps/generic/inttypes.h
new file mode 100644
index 0000000000..c5a74b8d2d
--- /dev/null
+++ b/sysdeps/generic/inttypes.h
@@ -0,0 +1 @@
+#error "This file must be written based on the data typs sizes of the target"
diff --git a/sysdeps/generic/mmap64.c b/sysdeps/generic/mmap64.c
new file mode 100644
index 0000000000..c0e886867a
--- /dev/null
+++ b/sysdeps/generic/mmap64.c
@@ -0,0 +1,48 @@
+/* Copyright (C) 1997 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
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   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.  */
+
+#include <errno.h>
+#include <sys/mman.h>
+#include <sys/types.h>
+
+/* Map addresses starting near ADDR and extending for LEN bytes.  From
+   OFFSET into the file FD describes according to PROT and FLAGS.  If ADDR
+   is nonzero, it is the desired mapping address.  If the MAP_FIXED bit is
+   set in FLAGS, the mapping will be at ADDR exactly (which must be
+   page-aligned); otherwise the system chooses a convenient nearby address.
+   The return value is the actual mapping address chosen or MAP_FAILED
+   for errors (in which case `errno' is set).  A successful `mmap' call
+   deallocates any previous mapping for the affected region.  */
+
+__ptr_t
+__mmap64 (__ptr_t addr, size_t len, int prot, int flags, int fd,
+	  __off64_t offset)
+{
+  off_t small_offset = (off_t) offset;
+
+  if (small_offset != offset)
+    {
+      /* We cannot do this since the offset is too large.  */
+      __set_errno (EOVERFLOW);
+      return MAP_FAILED;
+    }
+
+  return __mmap (addr, len, prot, flags, fd, small_offset);
+}
+
+weak_alias (__mmap64, mmap64)
diff --git a/sysdeps/generic/setrlimit64.c b/sysdeps/generic/setrlimit64.c
index 97329c58d8..57c5da44c1 100644
--- a/sysdeps/generic/setrlimit64.c
+++ b/sysdeps/generic/setrlimit64.c
@@ -43,4 +43,3 @@ setrlimit64 (resource, rlimits)
 }
 
 stub_warning (setrlimit64)
-#include <stub-tag.h>
diff --git a/sysdeps/generic/strtoimax.c b/sysdeps/generic/strtoimax.c
new file mode 100644
index 0000000000..f1de70f320
--- /dev/null
+++ b/sysdeps/generic/strtoimax.c
@@ -0,0 +1 @@
+#error "The correct implementation must be chosen based on the `intmax_t' type"
diff --git a/sysdeps/generic/strtoumax.c b/sysdeps/generic/strtoumax.c
new file mode 100644
index 0000000000..508cb19f8c
--- /dev/null
+++ b/sysdeps/generic/strtoumax.c
@@ -0,0 +1 @@
+#error "The correct implementation must be chosen based on the `uintmax_t' type"
diff --git a/sysdeps/generic/sys/mman.h b/sysdeps/generic/sys/mman.h
index f8ca3f03ee..f6e0196f70 100644
--- a/sysdeps/generic/sys/mman.h
+++ b/sysdeps/generic/sys/mman.h
@@ -100,6 +100,8 @@ extern __ptr_t mmap __P ((__ptr_t __addr, size_t __len, int __prot,
      __asm__ ("mmap64");
 #endif
 #ifdef __USE_LARGEFILE64
+extern __ptr_t __mmap64 __P ((__ptr_t __addr, size_t __len, int __prot,
+			      int __flags, int __fd, __off64_t __offset));
 extern __ptr_t mmap64 __P ((__ptr_t __addr, size_t __len, int __prot,
 			  int __flags, int __fd, __off64_t __offset));
 #endif
diff --git a/sysdeps/generic/wcstoimax.c b/sysdeps/generic/wcstoimax.c
new file mode 100644
index 0000000000..f1de70f320
--- /dev/null
+++ b/sysdeps/generic/wcstoimax.c
@@ -0,0 +1 @@
+#error "The correct implementation must be chosen based on the `intmax_t' type"
diff --git a/sysdeps/generic/wcstoumax.c b/sysdeps/generic/wcstoumax.c
new file mode 100644
index 0000000000..508cb19f8c
--- /dev/null
+++ b/sysdeps/generic/wcstoumax.c
@@ -0,0 +1 @@
+#error "The correct implementation must be chosen based on the `uintmax_t' type"
diff --git a/sysdeps/mach/powerpc/machine-lock.h b/sysdeps/mach/powerpc/machine-lock.h
new file mode 100644
index 0000000000..543927d048
--- /dev/null
+++ b/sysdeps/mach/powerpc/machine-lock.h
@@ -0,0 +1,75 @@
+/* Machine-specific definition for spin locks.  PowerPC version.
+   Copyright (C) 1994, 1997 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
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   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.  */
+
+#ifndef _MACHINE_LOCK_H
+#define	_MACHINE_LOCK_H
+
+/* The type of a spin lock variable.  */
+
+typedef __volatile long int __spin_lock_t;
+
+/* Value to initialize `__spin_lock_t' variables to.  */
+
+#define	__SPIN_LOCK_INITIALIZER	0L
+
+
+#ifndef _EXTERN_INLINE
+#define _EXTERN_INLINE extern __inline
+#endif
+
+/* Unlock LOCK.  */
+
+_EXTERN_INLINE void
+__spin_unlock (__spin_lock_t *__lock)
+{
+  __asm__ __volatile__ ("sync ; stwcx. %1,0,%0"
+			: : "r" (__lock), "r" (0) : "cr0");
+}
+
+/* Try to lock LOCK; return nonzero if we locked it, zero if another has.  */
+
+_EXTERN_INLINE int
+__spin_try_lock (register __spin_lock_t *__lock)
+{
+  long int __rtn;
+
+  __asm__ __volatile__ ("\
+0:	lwarx	%0,0,%1
+	stwcx.	%2,0,%1
+	bne-	0b
+" : "=&r"(__rtn) : "r"(__lock), "r"(1) : "cr0");
+  return ~__rtn;
+}
+
+/* Return nonzero if LOCK is locked.  */
+
+_EXTERN_INLINE int
+__spin_lock_locked (__spin_lock_t *__lock)
+{
+  long int __rtn;
+  __asm__ __volatile__ ("\
+0:	lwarx	%0,0,%1
+	stwcx.	%0,0,%1
+	bne-	0b
+" : "=&r"(__rtn) : "r"(__lock) : "cr0");
+  return __rtn;
+}
+
+
+#endif /* machine-lock.h */
diff --git a/sysdeps/posix/mk-stdiolim.c b/sysdeps/posix/mk-stdiolim.c
index 8858ebeae5..ec482dee96 100644
--- a/sysdeps/posix/mk-stdiolim.c
+++ b/sysdeps/posix/mk-stdiolim.c
@@ -49,7 +49,7 @@ main()
 
   /* These values correspond to the code in sysdeps/posix/tempname.c.
      Change the values here if you change that code.  */
-  puts ("#ifndef __need_FOPEN_MAX");
+  puts ("#ifdef _STDIO_H");
   printf ("# define L_tmpnam %u\n", sizeof ("/usr/tmp/") + 9);
   printf ("# define TMP_MAX %u\n", 62 * 62 * 62);
 
@@ -74,6 +74,8 @@ main()
 #endif
 	  );
 
+  puts ("# undef __need_FOPEN_MAX");
+  puts ("# define __need_FOPEN_MAX	1");
   puts ("#endif\n");
 
   /* POSIX does not require that OPEN_MAX and PATH_MAX be defined, so
diff --git a/sysdeps/powerpc/__longjmp.S b/sysdeps/powerpc/__longjmp.S
index 4a22fb8952..5d6422c500 100644
--- a/sysdeps/powerpc/__longjmp.S
+++ b/sysdeps/powerpc/__longjmp.S
@@ -19,6 +19,7 @@
 
 #include <sysdep.h>
 #define _ASM
+#define _SETJMP_H
 #include <bits/setjmp.h>
 
 ENTRY (__longjmp)
diff --git a/sysdeps/powerpc/atomicity.h b/sysdeps/powerpc/atomicity.h
new file mode 100644
index 0000000000..dba09658cb
--- /dev/null
+++ b/sysdeps/powerpc/atomicity.h
@@ -0,0 +1,99 @@
+/* Low-level functions for atomic operations.  PowerPC version.
+   Copyright (C) 1997 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
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   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.  */
+
+#ifndef _ATOMICITY_H
+#define _ATOMICITY_H	1
+
+#include <inttypes.h>
+
+static inline int
+__attribute__ ((unused))
+exchange_and_add (volatile uint32_t *mem, int val)
+{
+  int tmp, result;
+  __asm__ __volatile__ ("\
+0:	lwarx	%0,0,%2
+	add	%1,%3,%0
+	stwcx.	%1,0,%2
+	bne-	0b
+" : "=&r"(result), "=&r"(tmp) : "r" (mem), "r"(val) : "cr0");
+  return result;
+}
+
+static inline void
+__attribute__ ((unused))
+atomic_add (volatile uint32_t *mem, int val)
+{
+  int tmp;
+  __asm__ __volatile__("\
+0:	lwarx	%0,0,%1
+	add	%0,%2,%0
+	stwcx.	%0,0,%1
+	bne-	0b
+" : "=&r"(tmp) : "r" (mem), "r"(val) : "cr0");
+}
+
+static inline int
+__attribute__ ((unused))
+compare_and_swap (volatile long int *p, long int oldval, long int newval)
+{
+  int result;
+  __asm__ __volatile__ ("\
+0:	lwarx	%0,0,%1
+	xor.	%0,%0,%2
+	cntlzw	%0,%0
+	bne-	1f
+	stwcx.	%3,0,%1
+	bne-	0b
+1:	srwi	%0,%0,5
+" : "=&r"(result) : "r"(p), "r"(oldval), "r"(newval) : "cr0");
+  return result;
+}
+
+static inline long int
+__attribute__ ((unused))
+always_swap (volatile long int *p, long int newval)
+{
+  long int result;
+  __asm__ __volatile__ ("\
+0:	lwarx	%0,0,%1
+	stwcx.	%2,0,%1
+	bne-	0b
+" : "=&r"(result) : "r"(p), "r"(newval) : "cr0");
+  return result;
+}
+
+static inline int
+__attribute__ ((unused))
+test_and_set (volatile long int *p, long int oldval, long int newval)
+{
+  int result;
+  __asm__ __volatile__ ("\
+0:	lwarx	%0,0,%1
+	xor.	%0,%0,%2
+	cntlzw	%0,%0
+	bne-	1f
+	stwcx.	%3,0,%1
+	bne-	0b
+1:	srwi	%0,%0,5
+" : "=&r"(result) : "r"(p), "r"(oldval), "r"(newval) : "cr0");
+  return result;
+}
+
+#endif /* atomicity.h */
diff --git a/sysdeps/powerpc/bits/mathinline.h b/sysdeps/powerpc/bits/mathinline.h
index 24f186adf1..fff1d64ce2 100644
--- a/sysdeps/powerpc/bits/mathinline.h
+++ b/sysdeps/powerpc/bits/mathinline.h
@@ -18,28 +18,14 @@
    Boston, MA 02111-1307, USA.  */
 
 #ifdef __GNUC__
-#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__
-
-#ifdef __cplusplus
-# define __MATH_INLINE __inline
-#else
-# define __MATH_INLINE extern __inline
-#endif
-
-__MATH_INLINE double __sgn1 (double __x);
-__MATH_INLINE double
-__sgn1 (double __x)
-{
-  return __x >= 0.0 ? 1.0 : -1.0;
-}
-#endif /* !__NO_MATH_INLINES && __OPTIMIZE__ */
 
 #if __USE_ISOC9X && !defined _SOFT_FLOAT
 # define __unordered_cmp(x, y) \
   (__extension__							      \
    ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);			      \
       unsigned __r;							      \
-      __asm__("fcmpu 7,%1,%2 ; mfcr %0" : "=r" (__r) : "f" (__x), "f"(__y));  \
+      __asm__("fcmpu 7,%1,%2 ; mfcr %0" : "=r" (__r) : "f" (__x), "f"(__y)    \
+              : "cr7");  \
       __r; }))
 
 # define isgreater(x, y) (__unordered_cmp (x, y) >> 2 & 1)
@@ -50,4 +36,53 @@ __sgn1 (double __x)
 # define isunordered(x, y) (__unordered_cmp (x, y) & 1)
 #endif /* __USE_ISOC9X && !_SOFT_FLOAT */
 
+#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__
+
+#ifdef __cplusplus
+# define __MATH_INLINE __inline
+#else
+# define __MATH_INLINE extern __inline
+#endif  /* __cplusplus */
+
+#ifdef __USE_ISOC9X
+__MATH_INLINE long int lrint (double __x);
+__MATH_INLINE long int
+lrint (double __x)
+{
+  union {
+    double __d;
+    long int __ll[2];
+  } __u;
+  asm ("fctiw %0,%1" : "=f"(__u.__d) : "f"(__x));
+  return __u.__ll[1];
+}
+
+__MATH_INLINE long int lrintf (float __x);
+__MATH_INLINE long int
+lrintf (float __x)
+{
+  union {
+    double __d;
+    long int __ll[2];
+  } __u;
+  asm ("fctiw %0,%1" : "=f"(__u.__d) : "f"(__x));
+  return __u.__ll[1];
+}
+
+__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 /* __USE_ISOC9X */
+#endif /* !__NO_MATH_INLINES && __OPTIMIZE__ */
 #endif /* __GNUC__  */
diff --git a/sysdeps/powerpc/s_fdim.c b/sysdeps/powerpc/s_fdim.c
new file mode 100644
index 0000000000..da22f5c978
--- /dev/null
+++ b/sysdeps/powerpc/s_fdim.c
@@ -0,0 +1,31 @@
+/* Return positive difference between arguments.
+   Copyright (C) 1997 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
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   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.  */
+
+#include <math.h>
+
+double
+__fdim (double x, double y)
+{
+  return x < y ? 0 : x - y;
+}
+weak_alias (__fdim, fdim)
+#ifdef NO_LONG_DOUBLE
+strong_alias (__fdim, __fdiml)
+weak_alias (__fdim, fdiml)
+#endif
diff --git a/sysdeps/powerpc/s_fdimf.c b/sysdeps/powerpc/s_fdimf.c
new file mode 100644
index 0000000000..bebe7e58f3
--- /dev/null
+++ b/sysdeps/powerpc/s_fdimf.c
@@ -0,0 +1,27 @@
+/* Return positive difference between arguments.
+   Copyright (C) 1997 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
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   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.  */
+
+#include <math.h>
+
+float
+__fdimf (float x, float y)
+{
+  return x < y ? 0 : x - y;
+}
+weak_alias (__fdimf, fdimf)
diff --git a/sysdeps/powerpc/s_fmax.S b/sysdeps/powerpc/s_fmax.S
new file mode 100644
index 0000000000..559769a251
--- /dev/null
+++ b/sysdeps/powerpc/s_fmax.S
@@ -0,0 +1,43 @@
+/* Floating-point maximum.  PowerPC version.
+   Copyright (C) 1997 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
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   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.  */
+
+#include <sysdep.h>
+
+ENTRY(__fmax)
+/* double [f1] fmax (double [f1] x, double [f2] y); */
+	fcmpu	%cr0,%f1,%f2
+	blt	%cr0,0f		/* if x < y, neither x nor y can be NaN... */
+	bnulr+	%cr0
+/* x and y are unordered, so one of x or y must be a NaN... */
+	fcmpu	%cr1,%f2,%f2
+	bunlr	%cr1
+0:	fmr	%f1,%f2
+	blr
+END(__fmax)
+
+weak_alias(__fmax,fmax)
+
+/* It turns out that it's safe to use this code even for single-precision.  */
+strong_alias(__fmax,__fmaxf)
+weak_alias(__fmax,fmaxf)
+
+#ifdef NO_LONG_DOUBLE
+weak_alias(__fmax,__fmaxl)
+weak_alias(__fmax,fmaxl)
+#endif
diff --git a/sysdeps/powerpc/s_fmaxf.S b/sysdeps/powerpc/s_fmaxf.S
new file mode 100644
index 0000000000..3c2d62bb81
--- /dev/null
+++ b/sysdeps/powerpc/s_fmaxf.S
@@ -0,0 +1 @@
+/* __fmaxf is in s_fmax.c  */
diff --git a/sysdeps/powerpc/s_fmin.S b/sysdeps/powerpc/s_fmin.S
new file mode 100644
index 0000000000..72516c29f0
--- /dev/null
+++ b/sysdeps/powerpc/s_fmin.S
@@ -0,0 +1,43 @@
+/* Floating-point minimum.  PowerPC version.
+   Copyright (C) 1997 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
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   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.  */
+
+#include <sysdep.h>
+
+ENTRY(__fmin)
+/* double [f1] fmin (double [f1] x, double [f2] y); */
+	fcmpu	%cr0,%f1,%f2
+	bgt	%cr0,0f		/* if x > y, neither x nor y can be NaN... */
+	bnulr+	%cr0
+/* x and y are unordered, so one of x or y must be a NaN... */
+	fcmpu	%cr1,%f2,%f2
+	bunlr	%cr1
+0:	fmr	%f1,%f2
+	blr
+END(__fmin)
+
+weak_alias(__fmin,fmin)
+
+/* It turns out that it's safe to use this code even for single-precision.  */
+strong_alias(__fmin,__fminf)
+weak_alias(__fmin,fminf)
+
+#ifdef NO_LONG_DOUBLE
+weak_alias(__fmin,__fminl)
+weak_alias(__fmin,fminl)
+#endif
diff --git a/sysdeps/powerpc/s_fminf.S b/sysdeps/powerpc/s_fminf.S
new file mode 100644
index 0000000000..10ab7fe53c
--- /dev/null
+++ b/sysdeps/powerpc/s_fminf.S
@@ -0,0 +1 @@
+/* __fminf is in s_fmin.c  */
diff --git a/sysdeps/powerpc/s_llrint.c b/sysdeps/powerpc/s_llrint.c
index 7ca48c029a..1789e79860 100644
--- a/sysdeps/powerpc/s_llrint.c
+++ b/sysdeps/powerpc/s_llrint.c
@@ -1,5 +1,4 @@
-/* Round a long long floating point value to an integer in the current
-   rounding mode.
+/* Round a double value to a long long in the current rounding mode.
    Copyright (C) 1997 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -21,8 +20,12 @@
 #include "math.h"
 
 long long int
-__llrint (long double x)
+__llrint (double x)
 {
-  return (long long int) __rintl (x);
+  return (long long int) __rint (x);
 }
 weak_alias (__llrint, llrint)
+#ifdef NO_LONG_DOUBLE
+strong_alias (__llrint, __llrintl)
+weak_alias (__llrint, llrintl)
+#endif
diff --git a/sysdeps/powerpc/s_llrintf.c b/sysdeps/powerpc/s_llrintf.c
new file mode 100644
index 0000000000..2068a02a93
--- /dev/null
+++ b/sysdeps/powerpc/s_llrintf.c
@@ -0,0 +1,27 @@
+/* Round a float value to a long long in the current rounding mode.
+   Copyright (C) 1997 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
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   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.  */
+
+#include "math.h"
+
+long long int
+__llrintf (float x)
+{
+  return (long long int) __rintf (x);
+}
+weak_alias (__llrintf, llrintf)
diff --git a/sysdeps/powerpc/s_llround.c b/sysdeps/powerpc/s_llround.c
index fbe3a3217c..6b49dbf917 100644
--- a/sysdeps/powerpc/s_llround.c
+++ b/sysdeps/powerpc/s_llround.c
@@ -1,4 +1,4 @@
-/* Round long double value to long int.
+/* Round double value to long long int.
    Copyright (C) 1997 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -26,12 +26,12 @@
    clipping to MAX_LLONG or MIN_LLONG.  */
 
 long long int
-__llround (long double x)
+__llround (double x)
 {
-  long double xrf;
+  double xrf;
   long long int xr;
   xr = (long long int) x;
-  xrf = (long double) xr;
+  xrf = (double) xr;
   if (x >= 0.0)
     if (x - xrf >= 0.5 && x - xrf < 1.0 && x+1 > 0)
       return x+1;
@@ -44,3 +44,7 @@ __llround (long double x)
       return x;
 }
 weak_alias (__llround, llround)
+#ifdef NO_LONG_DOUBLE
+strong_alias (__llround, __llroundl)
+weak_alias (__llround, llroundl)
+#endif
diff --git a/sysdeps/powerpc/s_llroundf.c b/sysdeps/powerpc/s_llroundf.c
new file mode 100644
index 0000000000..23f1c28ab0
--- /dev/null
+++ b/sysdeps/powerpc/s_llroundf.c
@@ -0,0 +1,46 @@
+/* Round float value to long long int.
+   Copyright (C) 1997 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
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   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.  */
+
+#include <math.h>
+
+/* I think that what this routine is supposed to do is round a value
+   to the nearest integer, with values exactly on the boundary rounded
+   away from zero.  */
+/* This routine relies on (long long)x, when x is out of range of a long long,
+   clipping to MAX_LLONG or MIN_LLONG.  */
+
+long long int
+__llroundf (float x)
+{
+  float xrf;
+  long long int xr;
+  xr = (long long int) x;
+  xrf = (float) xr;
+  if (x >= 0.0)
+    if (x - xrf >= 0.5 && x - xrf < 1.0 && x+1 > 0)
+      return x+1;
+    else
+      return x;
+  else
+    if (xrf - x >= 0.5 && xrf - x < 1.0 && x-1 < 0)
+      return x-1;
+    else
+      return x;
+}
+weak_alias (__llroundf, llroundf)
diff --git a/sysdeps/powerpc/s_lrint.c b/sysdeps/powerpc/s_lrint.c
index 647cf30c9c..a060598859 100644
--- a/sysdeps/powerpc/s_lrint.c
+++ b/sysdeps/powerpc/s_lrint.c
@@ -19,26 +19,28 @@
 
 #include "math.h"
 
-#ifdef NO_LONG_DOUBLE
-
 long int
-__lrint (long double x)
-{
-  return (long int) __rintl(x);
-}
-
-#else
-
-long int
-__lrint (long double x)
+__lrint (double x)
 {
   union {
     double d;
     long int ll[2];
   } u;
   asm ("fctiw %0,%1" : "=f"(u.d) : "f"(x));
-  return d.ll[1];
+  return u.ll[1];
 }
+weak_alias (__lrint, lrint)
+
+/* This code will also work for a 'float' argument.  */
+asm ("\
+        .globl __lrintf
+        .globl lrintf
+        .weak lrintf
+	.set __lrintf,__lrint
+	.set lrintf,__lrint
+");
 
+#ifdef NO_LONG_DOUBLE
+strong_alias (__lrint, __lrintl)
+weak_alias (__lrint, lrintl)
 #endif
-weak_alias (__lrint, lrint)
diff --git a/sysdeps/powerpc/s_lrintf.S b/sysdeps/powerpc/s_lrintf.S
new file mode 100644
index 0000000000..e24766535f
--- /dev/null
+++ b/sysdeps/powerpc/s_lrintf.S
@@ -0,0 +1 @@
+/* __lrintf is in s_lrint.c  */
diff --git a/sysdeps/powerpc/s_lround.c b/sysdeps/powerpc/s_lround.c
index a6cb6c96d2..c52c0388f6 100644
--- a/sysdeps/powerpc/s_lround.c
+++ b/sysdeps/powerpc/s_lround.c
@@ -1,4 +1,4 @@
-/* Round long double value to long int.
+/* Round double value to long int.
    Copyright (C) 1997 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -26,12 +26,12 @@
    clipping to MAX_LONG or MIN_LONG.  */
 
 long int
-__lround (long double x)
+__lround (double x)
 {
-  long double xrf;
+  double xrf;
   long int xr;
   xr = (long int) x;
-  xrf = (long double) xr;
+  xrf = (double) xr;
   if (x >= 0.0)
     if (x - xrf >= 0.5 && x - xrf < 1.0 && x+1 > 0)
       return x+1;
@@ -44,3 +44,7 @@ __lround (long double x)
       return x;
 }
 weak_alias (__lround, lround)
+#ifdef NO_LONG_DOUBLE
+strong_alias (__lround, __lroundl)
+weak_alias (__lround, lroundl)
+#endif
diff --git a/sysdeps/powerpc/s_lroundf.c b/sysdeps/powerpc/s_lroundf.c
new file mode 100644
index 0000000000..ce1c3cf257
--- /dev/null
+++ b/sysdeps/powerpc/s_lroundf.c
@@ -0,0 +1,46 @@
+/* Round float value to long int.
+   Copyright (C) 1997 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
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   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.  */
+
+#include <math.h>
+
+/* I think that what this routine is supposed to do is round a value
+   to the nearest integer, with values exactly on the boundary rounded
+   away from zero.  */
+/* This routine relies on (long int)x, when x is out of range of a long int,
+   clipping to MAX_LONG or MIN_LONG.  */
+
+long int
+__lroundf (float x)
+{
+  float xrf;
+  long int xr;
+  xr = (long int) x;
+  xrf = (float) xr;
+  if (x >= 0.0)
+    if (x - xrf >= 0.5 && x - xrf < 1.0 && x+1 > 0)
+      return x+1;
+    else
+      return x;
+  else
+    if (xrf - x >= 0.5 && xrf - x < 1.0 && x-1 < 0)
+      return x-1;
+    else
+      return x;
+}
+weak_alias (__lroundf, lroundf)
diff --git a/sysdeps/powerpc/setjmp.S b/sysdeps/powerpc/setjmp.S
index 8fa863f161..dc9d923c75 100644
--- a/sysdeps/powerpc/setjmp.S
+++ b/sysdeps/powerpc/setjmp.S
@@ -19,6 +19,7 @@
 
 #include <sysdep.h>
 #define _ASM
+#define _SETJMP_H
 #include <bits/setjmp.h>
 
 ENTRY (__sigsetjmp)
diff --git a/sysdeps/unix/sysv/linux/Dist b/sysdeps/unix/sysv/linux/Dist
index e22cec7dec..6743794281 100644
--- a/sysdeps/unix/sysv/linux/Dist
+++ b/sysdeps/unix/sysv/linux/Dist
@@ -5,6 +5,7 @@ kernel_sigaction.h
 kernel_stat.h
 kernel_termios.h
 llseek.c
+oldsiglist.c
 s_pread64.c
 s_pwrite64.c
 siglist.h
@@ -21,6 +22,7 @@ net/ppp-comp.h
 net/ppp_defs.h
 net/route.h
 netatalk/at.h
+netax25/ax25.h
 netinet/if_fddi.h
 netinet/if_tr.h
 netinet/igmp.h
@@ -30,6 +32,7 @@ netinet/ip_icmp.h
 netinet/tcp.h
 netinet/udp.h
 netipx/ipx.h
+netrom/netrom.h
 nfs/nfs.h
 rt_sigaction.c
 rt_sigpending.c
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index 152c7984bd..29f1566753 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -69,7 +69,7 @@ ifeq ($(subdir),stdio-common)
 inhibit-siglist := yes
 
 ifeq ($(versioning),yes)
-aux += oldsiglist
+sysdep_routines += oldsiglist
 endif
 
 shared-only-routines += oldsiglist
@@ -79,7 +79,7 @@ ifeq ($(subdir),inet)
 sysdep_headers += netinet/in_systm.h netinet/udp.h \
 		  netinet/if_fddi.h netinet/if_tr.h netinet/igmp.h \
 		  netinet/ip_fw.h  netinet/ip_icmp.h netipx/ipx.h \
-		  sys/socketvar.h
+		  sys/socketvar.h netax25/ax25.h netrom/netrom.h
 endif
 
 ifeq ($(subdir),posix)
diff --git a/sysdeps/unix/sysv/linux/alpha/kernel_sigaction.h b/sysdeps/unix/sysv/linux/alpha/kernel_sigaction.h
index 6f8bc9bcd4..f8c42e0a1e 100644
--- a/sysdeps/unix/sysv/linux/alpha/kernel_sigaction.h
+++ b/sysdeps/unix/sysv/linux/alpha/kernel_sigaction.h
@@ -1,7 +1,7 @@
 /* This is the sigaction struction from the Linux 2.1.20 kernel.  */
 
 struct old_kernel_sigaction {
-	__sighandler_t sa_handler;
+	__sighandler_t k_sa_handler;
 	unsigned long sa_mask;
 	unsigned int sa_flags;
 };
diff --git a/sysdeps/unix/sysv/linux/alpha/mmap64.c b/sysdeps/unix/sysv/linux/alpha/mmap64.c
new file mode 100644
index 0000000000..0dbd384a6a
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/alpha/mmap64.c
@@ -0,0 +1 @@
+/* mmap64 is the same as mmap. */
diff --git a/sysdeps/unix/sysv/linux/alpha/net/route.h b/sysdeps/unix/sysv/linux/alpha/net/route.h
new file mode 100644
index 0000000000..6c7d8dd015
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/alpha/net/route.h
@@ -0,0 +1,140 @@
+/* Copyright (C) 1997 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
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   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.  */
+
+/* Based on the 4.4BSD and Linux version of this file.  */
+
+#ifndef _NET_ROUTE_H
+#define _NET_ROUTE_H	1
+
+#include <features.h>
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+
+
+/* This structure gets passed by the SIOCADDRT and SIOCDELRT calls. */
+struct rtentry
+  {
+    unsigned long int rt_pad1;
+    struct sockaddr rt_dst;		/* Target address.  */
+    struct sockaddr rt_gateway;		/* Gateway addr (RTF_GATEWAY).  */
+    struct sockaddr rt_genmask;		/* Target network mask (IP).  */
+    unsigned short int rt_flags;
+    short int rt_pad2;
+    unsigned long int rt_pad3;
+    unsigned char rt_tos;
+    unsigned char rt_class;
+    short int rt_pad4[3];
+    short int rt_metric;		/* +1 for binary compatibility!  */
+    char *rt_dev;			/* Forcing the device at add.  */
+    unsigned long int rt_mtu;		/* Per route MTU/Window.  */
+    unsigned long int rt_window;	/* Window clamping.  */
+    unsigned short int rt_irtt;		/* Initial RTT.  */
+  };
+/* Compatibility hack.  */
+#define rt_mss	rt_mtu
+
+
+struct in6_rtmsg
+  {
+    struct in6_addr rtmsg_dst;
+    struct in6_addr rtmsg_src;
+    struct in6_addr rtmsg_gateway;
+    u_int32_t rtmsg_type;
+    u_int16_t rtmsg_dst_len;
+    u_int16_t rtmsg_src_len;
+    u_int32_t rtmsg_metric;
+    unsigned long int rtmsg_info;
+    u_int32_t rtmsg_flags;
+    int rtmsg_ifindex;
+  };
+
+
+#define	RTF_UP		0x0001		/* Route usable.  */
+#define	RTF_GATEWAY	0x0002		/* Destination is a gateway.  */
+
+#define	RTF_HOST	0x0004		/* Host entry (net otherwise).  */
+#define RTF_REINSTATE	0x0008		/* Reinstate route after timeout.  */
+#define	RTF_DYNAMIC	0x0010		/* Created dyn. (by redirect).  */
+#define	RTF_MODIFIED	0x0020		/* Modified dyn. (by redirect).  */
+#define RTF_MTU		0x0040		/* Specific MTU for this route.  */
+#define RTF_MSS		RTF_MTU		/* Compatibility.  */
+#define RTF_WINDOW	0x0080		/* Per route window clamping.  */
+#define RTF_IRTT	0x0100		/* Initial round trip time.  */
+#define RTF_REJECT	0x0200		/* Reject route.  */
+#define	RTF_STATIC	0x0400		/* Manually injected route.  */
+#define	RTF_XRESOLVE	0x0800		/* External resolver.  */
+#define RTF_NOFORWARD   0x1000		/* Forwarding inhibited.  */
+#define RTF_THROW	0x2000		/* Go to next class.  */
+#define RTF_NOPMTUDISC  0x4000		/* Do not send packets with DF.  */
+
+/* for IPv6 */
+#define RTF_DEFAULT	0x00010000	/* default - learned via ND	*/
+#define RTF_ALLONLINK	0x00020000	/* fallback, no routers on link	*/
+#define RTF_ADDRCONF	0x00040000	/* addrconf route - RA		*/
+
+#define RTF_LINKRT	0x00100000	/* link specific - device match	*/
+#define RTF_NONEXTHOP	0x00200000	/* route with no nexthop	*/
+
+#define RTF_CACHE	0x01000000	/* cache entry			*/
+#define RTF_FLOW	0x02000000	/* flow significant route	*/
+#define RTF_POLICY	0x04000000	/* policy route			*/
+
+#define RTCF_VALVE	0x00200000
+#define RTCF_MASQ	0x00400000
+#define RTCF_NAT	0x00800000
+#define RTCF_DOREDIRECT 0x01000000
+#define RTCF_LOG	0x02000000
+#define RTCF_DIRECTSRC	0x04000000
+
+#define RTF_LOCAL	0x80000000
+#define RTF_INTERFACE	0x40000000
+#define RTF_MULTICAST	0x20000000
+#define RTF_BROADCAST	0x10000000
+#define RTF_NAT		0x08000000
+
+#define RTF_ADDRCLASSMASK	0xF8000000
+#define RT_ADDRCLASS(flags)	((__u_int32_t) flags >> 23)
+
+#define RT_TOS(tos)		((tos) & IPTOS_TOS_MASK)
+
+#define RT_LOCALADDR(flags)	((flags & RTF_ADDRCLASSMASK) \
+				 == (RTF_LOCAL|RTF_INTERFACE))
+
+#define RT_CLASS_UNSPEC		0
+#define RT_CLASS_DEFAULT	253
+
+#define RT_CLASS_MAIN		254
+#define RT_CLASS_LOCAL		255
+#define RT_CLASS_MAX		255
+
+
+#define RTMSG_ACK		NLMSG_ACK
+#define RTMSG_OVERRUN		NLMSG_OVERRUN
+
+#define RTMSG_NEWDEVICE		0x11
+#define RTMSG_DELDEVICE		0x12
+#define RTMSG_NEWROUTE		0x21
+#define RTMSG_DELROUTE		0x22
+#define RTMSG_NEWRULE		0x31
+#define RTMSG_DELRULE		0x32
+#define RTMSG_CONTROL		0x40
+
+#define RTMSG_AR_FAILED		0x51	/* Address Resolution failed.  */
+
+#endif /* net/route.h */
diff --git a/sysdeps/unix/sysv/linux/alpha/syscalls.list b/sysdeps/unix/sysv/linux/alpha/syscalls.list
index af964718bc..9406892124 100644
--- a/sysdeps/unix/sysv/linux/alpha/syscalls.list
+++ b/sysdeps/unix/sysv/linux/alpha/syscalls.list
@@ -19,13 +19,13 @@ osf_sigprocmask	-	osf_sigprocmask	2	__osf_sigprocmask
 
 getpeername	-	getpeername	3	__getpeername	getpeername
 getpriority	-	getpriority	2	__getpriority	getpriority
-mmap		-	mmap		6	__mmap		mmap
+mmap		-	mmap		6	__mmap		mmap __mmap64 mmap64
 llseek		EXTRA	lseek		3	__llseek	llseek lseek64
 pread		EXTRA	pread		4	__pread		pread __pread64 pread64
 pwrite		EXTRA	pwrite		4	__pwrite	pwrite __pwrite64 pwrite64
 fstatfs		-	fstatfs		2	__fstatfs	fstatfs fstatfs64
 statfs		-	statfs		2	__statfs	statfs statfs64
-getrlimit	-	getrlimit	2	getrlimit	getrlimit64
+getrlimit	-	getrlimit	2	__getrlimit	getrlimit getrlimit64
 setrlimit	-	setrlimit	2	setrlimit	setrlimit64
 ftruncate	-	ftruncate	2	ftruncate	ftruncate64
 truncate	-	truncate	2	truncate	truncate64
diff --git a/sysdeps/unix/sysv/linux/bits/socket.h b/sysdeps/unix/sysv/linux/bits/socket.h
index 42a4f8b74f..34c2be4271 100644
--- a/sysdeps/unix/sysv/linux/bits/socket.h
+++ b/sysdeps/unix/sysv/linux/bits/socket.h
@@ -107,9 +107,6 @@ enum __socket_type
 #define SOL_IPV6        41
 #define SOL_ICMPV6      58
 #define SOL_RAW		255
-#define SOL_AX25        257
-#define SOL_ATALK       258
-#define SOL_NETROM      259
 #define SOL_ROSE        260
 #define SOL_DECNET      261
 #define SOL_X25         262
diff --git a/sysdeps/unix/sysv/linux/i386/Dist b/sysdeps/unix/sysv/linux/i386/Dist
index d762dc9416..75955fcc15 100644
--- a/sysdeps/unix/sysv/linux/i386/Dist
+++ b/sysdeps/unix/sysv/linux/i386/Dist
@@ -1,4 +1,6 @@
 bits/mman.h
 clone.S
+s_pwrite64.S
+s_pread64.S
 sys/perm.h
 sys/vm86.h
diff --git a/sysdeps/unix/sysv/linux/i386/sigaction.c b/sysdeps/unix/sysv/linux/i386/sigaction.c
index 05d187c432..90818c1dff 100644
--- a/sysdeps/unix/sysv/linux/i386/sigaction.c
+++ b/sysdeps/unix/sysv/linux/i386/sigaction.c
@@ -32,8 +32,8 @@ extern int __syscall_rt_sigaction (int, const struct sigaction *,
 				   struct sigaction *, size_t);
 
 /* The variable is shared between all wrappers around signal handling
-   functions which have RT equivalents.  It is defined in sigsuspend.c.  */
-extern int __libc_have_rt_sigs;
+   functions which have RT equivalents.  */
+int __libc_have_rt_sigs = -1;
 
 
 /* If ACT is not NULL, change the action for SIG to *ACT.
diff --git a/sysdeps/unix/sysv/linux/net/route.h b/sysdeps/unix/sysv/linux/net/route.h
index 2450d5154a..6cccbeee2e 100644
--- a/sysdeps/unix/sysv/linux/net/route.h
+++ b/sysdeps/unix/sysv/linux/net/route.h
@@ -19,10 +19,9 @@
 /* Based on the 4.4BSD and Linux version of this file.  */
 
 #ifndef _NET_ROUTE_H
-
 #define _NET_ROUTE_H	1
-#include <features.h>
 
+#include <features.h>
 #include <sys/socket.h>
 #include <sys/types.h>
 #include <netinet/in.h>
diff --git a/sysdeps/unix/sysv/linux/netatalk/at.h b/sysdeps/unix/sysv/linux/netatalk/at.h
index e0ccff8552..4c586106c6 100644
--- a/sysdeps/unix/sysv/linux/netatalk/at.h
+++ b/sysdeps/unix/sysv/linux/netatalk/at.h
@@ -16,8 +16,8 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#ifndef __NETATALK_ATALK_H
-#define __NETATALK_ATALK_H 1
+#ifndef _NETATALK_AT_H
+#define _NETATALK_AT_H 1
 
 #include <asm/types.h>
 #include <sys/socket.h>
@@ -25,4 +25,4 @@
 
 #define SOL_ATALK       258     /* sockopt level for atalk */
 
-#endif
+#endif	/* netatalk/at.h */
diff --git a/sysdeps/unix/sysv/linux/netax25/ax25.h b/sysdeps/unix/sysv/linux/netax25/ax25.h
new file mode 100644
index 0000000000..1bec5920aa
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/netax25/ax25.h
@@ -0,0 +1,147 @@
+/* Copyright (C) 1997 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
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   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.  */
+
+#ifndef _NETAX25_AX25_H
+#define _NETAX25_AX25_H	1
+
+#include <features.h>
+#include <bits/sockaddr.h>
+
+/* Setsockoptions(2) level.  Thanks to BSD these must match IPPROTO_xxx.  */
+#define SOL_AX25	257
+
+/* AX.25 flags: */
+#define AX25_WINDOW	1
+#define AX25_T1		2
+#define AX25_T2		5
+#define AX25_T3		4
+#define AX25_N2		3
+#define AX25_BACKOFF	6
+#define AX25_EXTSEQ	7
+#define AX25_IDLE	9
+#define	AX25_PACLEN	10
+#define AX25_IPMAXQUEUE 11
+#define AX25_KILL	99
+
+/* AX.25 socket ioctls: */
+#define SIOCAX25GETUID		(SIOCPROTOPRIVATE)
+#define SIOCAX25ADDUID		(SIOCPROTOPRIVATE+1)
+#define SIOCAX25DELUID		(SIOCPROTOPRIVATE+2)
+#define SIOCAX25NOUID		(SIOCPROTOPRIVATE+3)
+#define SIOCAX25BPQADDR		(SIOCPROTOPRIVATE+4)
+#define SIOCAX25GETPARMS	(SIOCPROTOPRIVATE+5)
+#define SIOCAX25SETPARMS	(SIOCPROTOPRIVATE+6)
+#define SIOCAX25OPTRT		(SIOCPROTOPRIVATE+7)
+#define SIOCAX25CTLCON		(SIOCPROTOPRIVATE+8)
+
+/* unknown: */
+#define AX25_NOUID_DEFAULT	0
+#define AX25_NOUID_BLOCK	1
+#define AX25_SET_RT_IPMODE	2
+
+/* Digipeating flags: */
+#define AX25_DIGI_INBAND	0x01	/* Allow digipeating within port */
+#define AX25_DIGI_XBAND		0x02	/* Allow digipeating across ports */
+
+/* Maximim number of digipeaters: */
+#define AX25_MAX_DIGIS 8
+
+
+typedef struct
+  {
+    char ax25_call[7];		/* 6 call + SSID (shifted ascii) */
+  }
+ax25_address;
+
+struct sockaddr_ax25
+  {
+    sa_family_t sax25_family;
+    ax25_address sax25_call;
+    int sax25_ndigis;
+  };
+
+/*
+ * The sockaddr struct with the digipeater adresses:
+ */
+struct full_sockaddr_ax25
+  {
+    struct sockaddr_ax25 fsa_ax25;
+    ax25_address fsa_digipeater[AX25_MAX_DIGIS];
+  };
+#define sax25_uid	sax25_ndigis
+
+struct ax25_routes_struct
+  {
+    ax25_address port_addr;
+    ax25_address dest_addr;
+    unsigned char digi_count;
+    ax25_address digi_addr[AX25_MAX_DIGIS];
+  };
+
+/* The AX.25 ioctl structure: */
+struct ax25_ctl_struct
+  {
+    ax25_address port_addr;
+    ax25_address source_addr;
+    ax25_address dest_addr;
+    unsigned int cmd;
+    unsigned long arg;
+  };
+
+/* AX.25 route structure: */
+struct ax25_route_opt_struct
+  {
+    ax25_address port_addr;
+    ax25_address dest_addr;
+    int cmd;
+    int arg;
+  };
+
+/* AX.25 BPQ stuff: */
+struct ax25_bpqaddr_struct
+  {
+    char dev[16];
+    ax25_address addr;
+  };
+
+/* Definitions for the AX.25 `values' fields: */
+#define	AX25_VALUES_IPDEFMODE	0	/* 'D'=DG 'V'=VC */
+#define	AX25_VALUES_AXDEFMODE	1	/* 8=Normal 128=Extended Seq Nos */
+#define	AX25_VALUES_NETROM	2	/* Allow NET/ROM  - 0=No 1=Yes */
+#define	AX25_VALUES_TEXT	3	/* Allow PID=Text - 0=No 1=Yes */
+#define	AX25_VALUES_BACKOFF	4	/* 'E'=Exponential 'L'=Linear */
+#define	AX25_VALUES_CONMODE	5	/* Allow connected modes - 0=No 1=Yes */
+#define	AX25_VALUES_WINDOW	6	/* Default window size for standard AX.25 */
+#define	AX25_VALUES_EWINDOW	7	/* Default window size for extended AX.25 */
+#define	AX25_VALUES_T1		8	/* Default T1 timeout value */
+#define	AX25_VALUES_T2		9	/* Default T2 timeout value */
+#define	AX25_VALUES_T3		10	/* Default T3 timeout value */
+#define	AX25_VALUES_N2		11	/* Default N2 value */
+#define	AX25_VALUES_DIGI	12	/* Digipeat mode */
+#define AX25_VALUES_IDLE	13	/* mode vc idle timer */
+#define AX25_VALUES_PACLEN	14	/* AX.25 MTU */
+#define AX25_VALUES_IPMAXQUEUE  15	/* Maximum number of buffers enqueued */
+#define	AX25_MAX_VALUES		20
+
+struct ax25_parms_struct
+  {
+    ax25_address port_addr;
+    unsigned short values[AX25_MAX_VALUES];
+  };
+
+#endif /* netax25/ax25.h */
diff --git a/sysdeps/unix/sysv/linux/netrom/netrom.h b/sysdeps/unix/sysv/linux/netrom/netrom.h
new file mode 100644
index 0000000000..b8c2af0c11
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/netrom/netrom.h
@@ -0,0 +1,80 @@
+/* Copyright (C) 1997 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
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   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.  */
+
+#ifndef _NETROM_NETROM_H
+#define _NETROM_NETROM_H	1
+
+#include <netax25/ax25.h>
+
+/* Setsockoptions(2) level.  Thanks to BSD these must match IPPROTO_xxx.  */
+#define SOL_NETROM	259
+
+/* NetRom control values: */
+#define NETROM_T1	1
+#define NETROM_T2	2
+#define NETROM_N2	3
+#define NETROM_PACLEN	5
+
+#define NETROM_KILL	99
+
+/* Type of route: */
+#define NETROM_NEIGH    0
+#define NETROM_NODE     1
+
+struct nr_route_struct
+  {
+    int type;
+    ax25_address callsign;
+    char device[16];
+    unsigned int quality;
+    char mnemonic[7];
+    ax25_address neighbour;
+    unsigned int obs_count;
+  };
+
+/* NetRom socket ioctls: */
+#define	SIOCNRGETPARMS		(SIOCPROTOPRIVATE+0)
+#define	SIOCNRSETPARMS		(SIOCPROTOPRIVATE+1)
+#define	SIOCNRDECOBS		(SIOCPROTOPRIVATE+2)
+#define	SIOCNRRTCTL		(SIOCPROTOPRIVATE+3)
+#define	SIOCNRCTLCON		(SIOCPROTOPRIVATE+4)
+
+/* NetRom parameter structure: */
+struct nr_parms_struct
+  {
+    unsigned int quality;
+    unsigned int obs_count;
+    unsigned int ttl;
+    unsigned int timeout;
+    unsigned int ack_delay;
+    unsigned int busy_delay;
+    unsigned int tries;
+    unsigned int window;
+    unsigned int paclen;
+  };
+
+/* NetRom control structure: */
+struct nr_ctl_struct
+  {
+    unsigned char index;
+    unsigned char id;
+    unsigned int cmd;
+    unsigned long arg;
+  };
+
+#endif /* netrom/netrom.h */
diff --git a/sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c b/sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c
index 6b4373db0f..211a56b9f0 100644
--- a/sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c
+++ b/sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c
@@ -29,12 +29,13 @@
     (envp) = (argv) + (argc) + 1;				\
     for (_tmp = (void **) (envp); *_tmp; ++_tmp)		\
       continue;							\
-    if (*_tmp == 0 && ((size_t)_tmp & 0xf) != 0)		\
+    /* The following '++' is important!  */			\
+    ++_tmp;							\
+    if (*_tmp == 0)						\
       {								\
 	size_t _test = (size_t)_tmp;				\
 	_test = _test + 0xf & ~0xf;				\
-	if (*(long *)_test == AT_PHDR)				\
-	  _tmp = (void **)_test;				\
+	_tmp = (void **)_test;					\
       }								\
     (auxp) = (void *) _tmp;					\
   } while (0)
diff --git a/sysdeps/unix/sysv/linux/powerpc/kernel_termios.h b/sysdeps/unix/sysv/linux/powerpc/kernel_termios.h
index c3908d7080..a40b3c19bd 100644
--- a/sysdeps/unix/sysv/linux/powerpc/kernel_termios.h
+++ b/sysdeps/unix/sysv/linux/powerpc/kernel_termios.h
@@ -20,7 +20,7 @@
 #define _KERNEL_TERMIOS_H 1
 
 /* We need the definition of tcflag_t, cc_t, and speed_t.  */
-#include <bits/termios.h>
+#include <termios.h>
 
 #define __KERNEL_NCCS 19
 
diff --git a/sysdeps/unix/sysv/linux/sigaction.c b/sysdeps/unix/sysv/linux/sigaction.c
index 3eb721454e..6b3d69d451 100644
--- a/sysdeps/unix/sysv/linux/sigaction.c
+++ b/sysdeps/unix/sysv/linux/sigaction.c
@@ -30,8 +30,8 @@ extern int __syscall_rt_sigaction (int, const struct sigaction *,
 				   struct sigaction *, size_t);
 
 /* The variable is shared between all wrappers around signal handling
-   functions which have RT equivalents.  It is defined in sigsuspend.c.  */
-extern int __libc_have_rt_sigs;
+   functions which have RT equivalents.  */
+int __libc_have_rt_sigs = -1;
 
 
 /* If ACT is not NULL, change the action for SIG to *ACT.
diff --git a/sysdeps/unix/sysv/linux/sigpending.c b/sysdeps/unix/sysv/linux/sigpending.c
index 4cecb8dc60..fade020d26 100644
--- a/sysdeps/unix/sysv/linux/sigpending.c
+++ b/sysdeps/unix/sysv/linux/sigpending.c
@@ -25,7 +25,7 @@ extern int __syscall_rt_sigpending (sigset_t *, size_t);
 
 
 /* The variable is shared between all wrappers around signal handling
-   functions which have RT equivalents.  It is defined in sigsuspend.c.  */
+   functions which have RT equivalents.  It is defined in sigaction.c.  */
 extern int __libc_have_rt_sigs;
 
 
diff --git a/sysdeps/unix/sysv/linux/sigprocmask.c b/sysdeps/unix/sysv/linux/sigprocmask.c
index dc262c88f4..63889a61dd 100644
--- a/sysdeps/unix/sysv/linux/sigprocmask.c
+++ b/sysdeps/unix/sysv/linux/sigprocmask.c
@@ -25,7 +25,7 @@ extern int __syscall_rt_sigprocmask (int, const sigset_t *, sigset_t *,
 				     size_t);
 
 /* The variable is shared between all wrappers around signal handling
-   functions which have RT equivalents.  It is defined in sigsuspend.c.  */
+   functions which have RT equivalents.  It is defined in sigaction.c.  */
 extern int __libc_have_rt_sigs;
 
 
diff --git a/sysdeps/unix/sysv/linux/sigsuspend.c b/sysdeps/unix/sysv/linux/sigsuspend.c
index 2cf34eb9b1..8d8fa8e709 100644
--- a/sysdeps/unix/sysv/linux/sigsuspend.c
+++ b/sysdeps/unix/sysv/linux/sigsuspend.c
@@ -25,8 +25,8 @@ extern int __syscall_rt_sigsuspend (const sigset_t *, size_t);
 
 
 /* The variable is shared between all wrappers around signal handling
-   functions which have RT equivalents.  */
-int __libc_have_rt_sigs = 1;
+   functions which have RT equivalents.  It is defined in sigaction.c.  */
+extern int __libc_have_rt_sigs;
 
 
 /* Change the set of blocked signals to SET,
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/mmap64.c b/sysdeps/unix/sysv/linux/sparc/sparc64/mmap64.c
new file mode 100644
index 0000000000..0dbd384a6a
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/mmap64.c
@@ -0,0 +1 @@
+/* mmap64 is the same as mmap. */
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list b/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list
index 7e64daf578..ca142da29c 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list
@@ -10,6 +10,7 @@ getrlimit	-	getrlimit	2	getrlimit	getrlimit64
 setrlimit	-	setrlimit	2	setrlimit	setrlimit64
 ftruncate	-	ftruncate	2	ftruncate	ftruncate64
 truncate	-	truncate	2	truncate	truncate64
+mmap		-	mmap		6	__mmap		mmap __mmap64 mmap64
 
 # Override select.S in parent directory:
 select		-	select		5	__select	select
diff --git a/sysdeps/unix/sysv/linux/stdio_lim.h.in b/sysdeps/unix/sysv/linux/stdio_lim.h.in
index 07280956f2..bded904ef0 100644
--- a/sysdeps/unix/sysv/linux/stdio_lim.h.in
+++ b/sysdeps/unix/sysv/linux/stdio_lim.h.in
@@ -21,7 +21,7 @@
 # error "Never include <bits/stdio_lim.h> directly; use <stdio.h> instead."
 #endif
 
-#ifndef __need_FOPEN_MAX
+#ifdef _STDIO_H
 # define L_tmpnam 19
 # define TMP_MAX 238328
 
@@ -31,6 +31,9 @@
 # endif
 
 # define FILENAME_MAX	DEFAULT_FILENAME_MAX
+
+# undef __need_FOPEN_MAX
+# define __need_FOPEN_MAX
 #endif
 
 #if defined __need_FOPEN_MAX && !defined __defined_FOPEN_MAX
diff --git a/sysdeps/unix/sysv/linux/sys/kd.h b/sysdeps/unix/sysv/linux/sys/kd.h
index 0ff5220014..b37586abfd 100644
--- a/sysdeps/unix/sysv/linux/sys/kd.h
+++ b/sysdeps/unix/sysv/linux/sys/kd.h
@@ -20,7 +20,9 @@
 #define _SYS_KD_H	1
 
 /* Make sure the <linux/types.h> header is not loaded.  */
-#define _LINUX_TYPES_H	1
+#ifndef _LINUX_TYPES_H
+# define _LINUX_TYPES_H	1
+#endif
 
 #include <linux/kd.h>
 
diff --git a/sysdeps/unix/sysv/linux/sys/mman.h b/sysdeps/unix/sysv/linux/sys/mman.h
index e2434f135f..70f95d080f 100644
--- a/sysdeps/unix/sysv/linux/sys/mman.h
+++ b/sysdeps/unix/sysv/linux/sys/mman.h
@@ -42,18 +42,20 @@ __BEGIN_DECLS
    deallocates any previous mapping for the affected region.  */
 
 extern __ptr_t __mmap __P ((__ptr_t __addr, size_t __len, int __prot,
-			  int __flags, int __fd, __off_t __offset));
+			    int __flags, int __fd, __off_t __offset));
 #ifndef __USE_FILE_OFFSET64
 extern __ptr_t mmap __P ((__ptr_t __addr, size_t __len, int __prot,
-			int __flags, int __fd, __off_t __offset));
+			  int __flags, int __fd, __off_t __offset));
 #else
 extern __ptr_t mmap __P ((__ptr_t __addr, size_t __len, int __prot,
-			int __flags, int __fd, __off_t __offset))
+			  int __flags, int __fd, __off64_t __offset))
      __asm__ ("mmap64");
 #endif
 #ifdef __USE_LARGEFILE64
+extern __ptr_t __mmap64 __P ((__ptr_t __addr, size_t __len, int __prot,
+			      int __flags, int __fd, __off64_t __offset));
 extern __ptr_t mmap64 __P ((__ptr_t __addr, size_t __len, int __prot,
-			  int __flags, int __fd, __off64_t __offset));
+			    int __flags, int __fd, __off64_t __offset));
 #endif
 
 /* Deallocate any mapping for the region starting at ADDR and extending LEN
diff --git a/sysdeps/wordsize-32/Dist b/sysdeps/wordsize-32/Dist
deleted file mode 100644
index 36bfb62e73..0000000000
--- a/sysdeps/wordsize-32/Dist
+++ /dev/null
@@ -1,5 +0,0 @@
-inttypes.h
-strtoimax.c
-strtoumax.c
-wcstoimax.c
-wcstoumax.c
diff --git a/sysdeps/wordsize-32/Makefile b/sysdeps/wordsize-32/Makefile
deleted file mode 100644
index b22eaee177..0000000000
--- a/sysdeps/wordsize-32/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-ifeq ($(subdir),stdlib)
-sysdep_headers += inttypes.h
-
-sysdep_routines += strtoimax strtoumax wcstoimax wcstoumax
-endif
diff --git a/sysdeps/wordsize-64/Dist b/sysdeps/wordsize-64/Dist
deleted file mode 100644
index 36bfb62e73..0000000000
--- a/sysdeps/wordsize-64/Dist
+++ /dev/null
@@ -1,5 +0,0 @@
-inttypes.h
-strtoimax.c
-strtoumax.c
-wcstoimax.c
-wcstoumax.c
diff --git a/sysdeps/wordsize-64/Makefile b/sysdeps/wordsize-64/Makefile
deleted file mode 100644
index b22eaee177..0000000000
--- a/sysdeps/wordsize-64/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-ifeq ($(subdir),stdlib)
-sysdep_headers += inttypes.h
-
-sysdep_routines += strtoimax strtoumax wcstoimax wcstoumax
-endif