summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--BUGS10
-rw-r--r--ChangeLog289
-rw-r--r--FAQ23
-rw-r--r--Makerules8
-rw-r--r--NEWS2
-rw-r--r--README.template2
-rw-r--r--Rules18
-rw-r--r--SNAP285
-rwxr-xr-xconfigure137
-rw-r--r--configure.in7
-rw-r--r--db/makedb.c2
-rw-r--r--dirent/scandir.c5
-rw-r--r--elf/dl-addr.c11
-rw-r--r--elf/dl-lookup.c1
-rw-r--r--elf/dl-minimal.c4
-rw-r--r--elf/ldd.bash.in6
-rw-r--r--elf/ldd.sh.in6
-rw-r--r--elf/rtld.c6
-rw-r--r--intl/locale.alias2
-rw-r--r--io/ftwtest-sh28
-rw-r--r--libio/genops.c1
-rw-r--r--libio/iofdopen.c20
-rw-r--r--libio/iopopen.c4
-rw-r--r--libio/iovdprintf.c24
-rw-r--r--libio/libioP.h2
-rw-r--r--libio/stdfiles.c2
-rw-r--r--libio/stdio.c3
-rw-r--r--libio/stdio.h8
-rw-r--r--login/Makefile2
-rw-r--r--login/README.utmpd174
-rw-r--r--login/programs/utmpd.c6
-rw-r--r--malloc/malloc.c4
-rw-r--r--malloc/obstack.h2
-rw-r--r--malloc/thread-m.h43
-rw-r--r--manual/arith.texi4
-rw-r--r--manual/filesys.texi5
-rw-r--r--manual/job.texi18
-rw-r--r--manual/pattern.texi15
-rw-r--r--manual/string.texi6
-rw-r--r--manual/terminal.texi15
-rw-r--r--math/Makefile2
-rw-r--r--math/bits/mathcalls.h15
-rw-r--r--misc/syslog.c2
-rw-r--r--nis/libnsl.map2
-rw-r--r--nis/nis_call.c4
-rw-r--r--posix/confstr.c10
-rw-r--r--posix/unistd.h17
-rw-r--r--posix/wordexp.c243
-rw-r--r--rpm/template29
-rw-r--r--stdio-common/Makefile3
-rw-r--r--stdio-common/_itoa.c6
-rw-r--r--stdio-common/itoa-digits.c26
-rw-r--r--stdlib/mblen.c31
-rw-r--r--stdlib/stdlib.h8
-rw-r--r--string/bits/string2.h221
-rw-r--r--sunrpc/clnt_perr.c2
-rw-r--r--sunrpc/get_myaddr.c1
-rw-r--r--sunrpc/pmap_clnt.c2
-rw-r--r--sunrpc/rpc/clnt.h9
-rw-r--r--sysdeps/generic/_strerror.c2
-rw-r--r--sysdeps/generic/des_impl.c2
-rw-r--r--sysdeps/generic/dl-cache.c21
-rw-r--r--sysdeps/generic/memcmp.c54
-rw-r--r--sysdeps/generic/pread.c3
-rw-r--r--sysdeps/generic/pread64.c3
-rw-r--r--sysdeps/generic/pwrite.c3
-rw-r--r--sysdeps/generic/pwrite64.c3
-rw-r--r--sysdeps/i386/i486/bits/string.h12
-rw-r--r--sysdeps/libm-ieee754/s_llrintl.c23
-rw-r--r--sysdeps/libm-ieee754/s_lrintl.c4
-rw-r--r--sysdeps/libm-ieee754/s_nextafterxf.c2
-rw-r--r--sysdeps/m68k/fpu/bits/mathinline.h69
-rw-r--r--sysdeps/m68k/fpu/s_lrint.c16
-rw-r--r--sysdeps/m68k/fpu/s_lrintf.c3
-rw-r--r--sysdeps/m68k/fpu/s_lrintl.c3
-rw-r--r--sysdeps/m68k/fpu/s_scalbln.c2
-rw-r--r--sysdeps/m68k/fpu/s_scalblnf.c2
-rw-r--r--sysdeps/m68k/fpu/s_scalblnl.c2
-rw-r--r--sysdeps/m68k/fpu/s_scalbn.c29
-rw-r--r--sysdeps/m68k/fpu/s_scalbnf.c4
-rw-r--r--sysdeps/m68k/fpu/s_scalbnl.c4
-rw-r--r--sysdeps/m68k/sys/ucontext.h108
-rw-r--r--sysdeps/posix/pread.c6
-rw-r--r--sysdeps/posix/pread64.c60
-rw-r--r--sysdeps/posix/pwrite.c3
-rw-r--r--sysdeps/posix/pwrite64.c59
-rw-r--r--sysdeps/powerpc/bits/fenv.h4
-rw-r--r--sysdeps/powerpc/bits/mathinline.h6
-rw-r--r--sysdeps/powerpc/dl-machine.h5
-rw-r--r--sysdeps/sparc/sparc32/elf/start.S2
-rw-r--r--sysdeps/unix/sysv/linux/Makefile4
-rw-r--r--sysdeps/unix/sysv/linux/alpha/pread64.c1
-rw-r--r--sysdeps/unix/sysv/linux/alpha/pwrite64.c1
-rw-r--r--sysdeps/unix/sysv/linux/alpha/syscalls.list2
-rw-r--r--sysdeps/unix/sysv/linux/bits/socket.h16
-rw-r--r--sysdeps/unix/sysv/linux/net/if_arp.h3
-rw-r--r--sysdeps/unix/sysv/linux/net/if_packet.h26
-rw-r--r--sysdeps/unix/sysv/linux/pread.c28
-rw-r--r--sysdeps/unix/sysv/linux/pread64.c53
-rw-r--r--sysdeps/unix/sysv/linux/pwrite.c28
-rw-r--r--sysdeps/unix/sysv/linux/pwrite64.c53
-rw-r--r--sysdeps/unix/sysv/linux/s_pread64.c30
-rw-r--r--sysdeps/unix/sysv/linux/s_pwrite64.c30
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/init-first.h4
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/socket.S48
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/pread64.c1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/pwrite64.c1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list2
-rw-r--r--sysdeps/unix/sysv/linux/sys/prctl.h32
-rw-r--r--sysdeps/unix/sysv/linux/syscalls.list2
-rw-r--r--termios/Makefile2
-rw-r--r--termios/tcgetsid.c64
-rw-r--r--termios/termios.h14
113 files changed, 2319 insertions, 488 deletions
diff --git a/BUGS b/BUGS
index 10f72edabd..afe188ccd0 100644
--- a/BUGS
+++ b/BUGS
@@ -1,7 +1,7 @@
 	    List of known bugs (certainly very incomplete)
 	    ----------------------------------------------
 
-Time-stamp: <1997-09-28T22:58:35+0200 drepper>
+Time-stamp: <1997-10-25T06:32:15+0200 drepper>
 
 This following list contains those bugs which I'm aware of.  Please
 make sure that bugs you report are not listed here.  If you can fix one
@@ -10,7 +10,7 @@ of these bugs/limitations I'll certainly be glad to receive a patch.
 Another source of information about bugs is the problem data base of the
 GNU project.  There is an easy to use WWW interface available at
 
-	http://www-gnats.gnu.ai.mit.edu:8080/cgi-bin/wwwgnats.pl
+       http://www-gnats.gnu.org:8080/cgi-bin/wwwgnats.pl
 
 I would appreciate it very much if you could verify the problem was not
 reported before by looking through the database.  To make the information
@@ -70,6 +70,12 @@ Severity: [  *] to [***]
        have this bug).
        [PR libc/245]
 
+[  *]  gethostbyname returns HOST_NOT_FOUND if the nameserver is
+       unreachable and nsswitch.conf contains a line with:
+       hosts: files dns
+       If the only method is dns gethostbyname return
+       TRY_AGAIN.  gethostbyname should return in both cases TRY_AGAIN.
+       [PR libc/244]
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Ulrich Drepper
 drepper@cygnus.com
diff --git a/ChangeLog b/ChangeLog
index 148799486d..82a31444a5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,293 @@
+1997-10-26 18:12  Ulrich Drepper  <drepper@cygnus.com>
+
+	* libio/genops.c: Partial undo of last patch.
+	* libio/stdfiles.c: Likewise.
+	* libio/iofdopen.c: Use _IO_FILE_complete, not _IO_file_plus.
+	* libio/iopopen.c: Likewise.
+	* libio/iovdprintf.c: Likewise.
+	* libio/libio.h: Remove duplicated `;'.
+	* libio/stdio.c: Remove misleading comment.
+	* libio/stdio.h: Declare standard streams as variables.
+
+	* login/Makefile (distribute): Add README.utmpd.
+	* login/README.utmpd: New file.
+	Provided by Mark M. Kettenis <kettenis@phys.uva.nl>.
+
+	* manual/job.texi: Document tcgetsid.
+	* manual/pattern.texi: Document globfree.
+	* manual/terminal.texi: Document B38400 ... B460800.
+
+	* posix/confstr.c: Print "-D_FILE_OFFSET_SIZE=64" for _CS_LFS_CFLAGS.
+
+	* posix/unistd.h: Add explanation of _POSIX_* constants.
+
+	* posix/unists.h: Add prototypes for __pread, __pread64, __pwrite
+	and __pwrite64.
+	* sysdeps/generic/pread.c: Define as __pread and make pread weak alias.
+	* sysdeps/generic/pread64.c: Likewise.
+	* sysdeps/generic/pwrite.c: Likewise.
+	* sysdeps/generic/pwrite64.c: Likewise.
+	* sysdeps/posix/pread.c: Likewise.
+	* sysdeps/posix/pwrite.c: Likewise.
+	* sysdeps/posix/pread64.c: New file.
+	* sysdeps/posix/pwrite64.c: Likewise.
+	* sysdeps/unix/sysv/linux/Makefile [$(subdir)=posix] (sysdep_routines):
+	Add s_pread64 and s_pwrite64.
+	* sysdeps/unix/sysv/linux/pread.c: New file.
+	* sysdeps/unix/sysv/linux/pread64.c: New file.
+	* sysdeps/unix/sysv/linux/pwrite.c: New file.
+	* sysdeps/unix/sysv/linux/pwrite64.c: New file.
+	* sysdeps/unix/sysv/linux/s_pread64.c: New file.
+	* sysdeps/unix/sysv/linux/s_pwrite64.c: New file.
+	* sysdeps/unix/sysv/linux/syscalls.list: Add pread and pwrite.
+	* sysdeps/unix/sysv/linux/alpha/pread64.c: New (empty) file.
+	* sysdeps/unix/sysv/linux/alpha/pwrite64.c: New (empty) file.
+	* sysdeps/unix/sysv/linux/sparc/sparc64/pread64.c: New (empty) file.
+	* sysdeps/unix/sysv/linux/sparc/sparc64/pwrite64.c: New (empty) file.
+	* sysdeps/unix/sysv/linux/alpha/syscalls.list: Add pread and pwrite
+	with weak aliases for *64 functions.
+	* sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list: Likewise.
+
+	* string/bits/string2.h: Add casts to allow void * arguments.
+
+	* sysdeps/i386/i486/bits/string.h: Define index and rindex only if
+	__USE_BSD or __USE_XOPEN_EXTENDED.
+
+	* sysdeps/unix/sysv/linux/bits/socket.h: Add SCM_RIGHTS and other
+	SCM_* constants from kernel header.
+
+	* termios/termios.h: Add prototype for tcgetsid.
+
+1997-10-26 13:26  Thorsten Kukuk  <kukuk@vt.uni-paderborn.de>
+
+	* sunrpc/clnt_perr.c: Add trailing '\0' to strings.
+
+	* sunrpc/get_myaddr.c: Include rpc/clnt.h for prototypes.
+
+	* sunrpc/pmap_clnt.c: Use get_myaddress from header file.
+
+1997-10-26 05:26  Ulrich Drepper  <drepper@cygnus.com>
+
+	* configure.in: Punt if any directory mentioned in the
+	enable-add-on parameter does not exist.
+
+1997-10-25 19:25  Ulrich Drepper  <drepper@cygnus.com>
+
+	* termios/Makefile (routines): Add tcgetsid.
+	* termios/tcgetsid.c: New file.
+	Provided by Mark M. Kettenis <kettenis@phys.uva.nl>.
+
+1997-10-25 18:56  Ulrich Drepper  <drepper@cygnus.com>
+
+	* stdlib/stdlib.h: Remove mblen optimization.
+	* stdlib/mblen.c: Rewrite to make sure global state is not changed.
+	Reported by anderson@metrolink.com.
+
+1997-10-19 21:51  Wolfram Gloger  <wg@wolfram.dent.med.uni-muenchen.de>
+
+	* malloc/thread-m.h [_LIBC]:  Use new __libc_internal_tsd_{set,get}
+	interface for thread-specific data.
+
+1997-10-25 06:51  Ulrich Drepper  <drepper@cygnus.com>
+
+	* elf/dl-addr.c: Use braces for correct logical grouping.
+	Patch by Wolfram Gloger <wmglo@dent.med.uni-muenchen.de>.
+
+1997-10-18 09:15  Geoff Keating  <geoffk@ozemail.com.au>
+
+	* io/ftwtest-sh: Sometimes /tmp is a symlink to somewhere more
+	convenient; that caused this test to break.
+
+	* sysdeps/powerpc/dl-machine.h: Fix typo.
+
+	* sysdeps/powerpc/bits/fenv.h: Don't use floating-point registers
+	when -msoft-float is in effect, because this causes compilation to
+	stop.
+	* sysdeps/powerpc/bits/mathinlines.h: Likewise.
+
+	* rpm/template: Add description, use RPM flags rather than the ones
+	used to build the spec.  Build in a temporary directory, not /.
+
+	* elf/dl-lookup.c: Don't include _itoa.h, it's not used.
+	* elf/dl-minimal.c: Use _itoa_word rather than _itoa.  It seems that
+	_itoa is the only routine that ld.so uses that requires something
+	from libgcc.a on powerpc, so it would be best to avoid it in ld.so.
+	* elf/rtld.c: Likewise.
+	* sysdeps/generic/_strerror.c: Likewise.
+	* stdio-common/_itoa.c: Split out digits strings.
+	* stdio-common/itoa-digits.c: New file.
+	* stdio-common/Makefile: Add itoa-digits.
+
+1997-10-21  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
+
+	* manual/filesys.texi (Scanning Directory Content): Document error
+	case more.
+
+	* dirent/scandir.c (scandir): Ignore errors from select function.
+	Suggested by urbanw@cs.umu.se (closes PR libc/316).
+
+1997-10-25 06:18  Ulrich Drepper  <drepper@cygnus.com>
+
+	* sysdeps/unix/sysv/linux/sparc/sparc32/socket.S: Corrections.
+	Patch by Erik Troan <ewt@redhat.com>.
+
+1997-10-25 04:00  Ulrich Drepper  <drepper@cygnus.com>
+
+	* sysdeps/generic/dl-cache.c (_dl_load_cache_lookup): Favour exact
+	matching of version function if both the general (1) and
+	glibc-specific (3) entry are present.
+
+1997-10-22 18:47  Thorsten Kukuk  <kukuk@vt.uni-paderborn.de>
+
+	* sunrpc/rpc/clnt.h: Add get_myaddress prototype.
+
+	* nis/libnsl.map: Fix typo.
+
+	* nis/nis_call.c: Fix memory leak.
+
+1997-10-22 19:29  Ulrich Drepper  <drepper@cygnus.com>
+
+	* sysdeps/generic/memcmp.c: Define __P if not defined before.
+	Patch by Jim Meyering <meyering@eng.ascend.com>.
+
+1997-10-21 22:09  Ulrich Drepper  <drepper@cygnus.com>
+
+	* sysdeps/unix/sysv/linux/sys/prctl.h: New file by Richard Gooch
+	<rgooch@atnf.csiro.au>.
+
+1997-10-21 21:50  Ulrich Drepper  <drepper@cygnus.com>
+
+	* misc/syslog.c (vsyslog): Open console with O_NOCTTY.
+	Patch by Zack Weinberg <zack@rabi.phys.columbia.edu>.
+
+1997-10-21 18:07  Ulrich Drepper  <drepper@cygnus.com>
+
+	* posix/wordexp.c: Improve handling of $... expressions.
+	Patch by Tim Waugh <tim@cyberelk.demon.co.uk>.
+
+1997-10-21 16:12  Ulrich Drepper  <drepper@cygnus.com>
+
+	* manual/string.texi: Correct return values of bcopy and bzero.
+	Patch by Matthew Wilcox <willy@odie.barnet.ac.uk>.
+
+1997-10-18 15:03  Philip Blundell  <Philip.Blundell@pobox.com>
+
+	* sysdeps/unix/sysv/linux/bits/socket.h: Correct types of some
+	elements in struct msghdr and struct cmsghdr, to keep in step with
+	the kernel.
+
+1997-10-17 22:29  Ulrich Drepper  <drepper@cygnus.com>
+
+	* sysdeps/unix/sysv/linux/sparc/sparc32/init-first.h: Fix another
+	bug in startup code.
+	Patch by Eric Delaunay <delaunay@lix.polytechnique.fr>.
+
+1997-10-16 20:17  Richard Henderson  <rth@cygnus.com>
+
+	* sysdeps/unix/sysv/linux/sparc/sparc32/socket.S: Dump args to the
+	stack and give the kernel a pointer.  Use the sysdep.h macros.
+
+1997-10-17 04:07  Ulrich Drepper  <drepper@cygnus.com>
+
+	* sysdeps/sparc/sparc32/elf/start.S: Calculate argv correctly.
+	Patch by Eric Delaunay <delaunay@lix.polytechnique.fr>.
+
+1997-10-16  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
+
+	* sysdeps/libm-ieee754/s_nextafterxf.c [!__STDC__]: Correct typo.
+
+1997-10-16 14:50  Ulrich Drepper  <drepper@cygnus.com>
+
+	* manual/pattern.texi: Document globfree.
+
+1997-10-15 21:11  Philip Blundell  <Philip.Blundell@pobox.com>
+
+	* sysdeps/unix/sysv/linux/net/if_packet.h: New file.
+	* sysdeps/unix/sysv/linux/Makefile (sysdep_headers): Add
+	net/if_packet.h.
+
+	* sysdeps/unix/sysv/linux/net/if_arp.h (ARPHRD_ASH): New type, for
+	64Mbps ASH.
+	(ARPHRD_ETHER): This is used for 100Mbps networks too.
+
+1997-10-15  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
+
+	* Makerules (install): Use full pathnames for linker script.
+	This is to work around a limitation in `ld' while no better solution
+	is possible.
+
+1997-10-15  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
+
+	* malloc/malloc.c (mmap_chunk): Put inline before static in
+	function definition to avoid compiler warning.
+	(malloc_extend): Likewise.
+
+	* sysdeps/generic/des_impl.c: Include "des.h" to avoid warning.
+
+1997-10-15  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
+
+	* NEWS: Fix @gnu.ai.mit.edu -> @gnu.org.
+	* README.template: Likewise.
+	* db/makedb.c: Likewise.
+	* elf/ldd.bash.in: Likewise.
+	* elf/ldd.sh.in: Likewise.
+	* intl/locale.alias: Likewise.
+	* login/programs/utmpd.c: Likewise.
+	* libio/stdfiles.c [!_IO_MTSAFE] (DEF_STDFILE): Fix parameter list.
+
+1997-10-14  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
+
+	* Rules: Remove all empty.* files.
+	(shared-only-routines): Correct implementation.
+
+1997-10-14  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
+
+	* sysdeps/libm-ieee754/s_lrintl.c: Make compilable.
+	* sysdeps/libm-ieee754/s_llrintl.c: Likewise.  Optimized.
+
+1997-10-14  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
+
+	* elf/ldd.bash.in: Only prepend ./ if the file contains no slash
+	at all.
+	* elf/ldd.sh.in: Likewise.
+
+1997-10-14  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
+
+	* sysdeps/m68k/sys/ucontext.h: New file.
+
+1997-10-13  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
+
+	* sysdeps/m68k/fpu/s_scalbln.c: New (empty) file.
+	* sysdeps/m68k/fpu/s_scalblnf.c: New (empty) file.
+	* sysdeps/m68k/fpu/s_scalblnl.c: New (empty) file.
+
+	* sysdeps/m68k/fpu/s_scalbn.c: Add scalbln alias.
+	* sysdeps/m68k/fpu/s_scalbnf.c: Adapted.
+	* sysdeps/m68k/fpu/s_scalbnl.c: Adapted.
+
+	* sysdeps/m68k/fpu/s_lrint.c: Add standard skeleton stuff.
+	* sysdeps/m68k/fpu/s_lrintf.c: New file.
+	* sysdeps/m68k/fpu/s_lrintl.c: New file.
+
+	* sysdeps/m68k/fpu/bits/mathinline.h: Add fma and scalbln.  Update
+	lrint and scalbn.
+	(__m81_inline) [__cplusplus]: Define to __inline.
+
+	* math/bits/mathcalls.h: Remove whitespace before second argument
+	of __MATHDECL.  Add note explaining this.
+
+1997-10-13  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
+
+	* manual/arith.texi (Absolute Value): Spelling fix.
+
+1997-10-13  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
+
+	* malloc/obstack.h (obstack_empty_p) [!__GNUC__]: Properly
+	parenthesize the macro parameter.
+
 1997-10-15 06:56  Ulrich Drepper  <drepper@cygnus.com>
 
-	* Rules: Remove ruls to magically install <subdir>.h headers.
+	* Rules: Remove rules to magically install <subdir>.h headers.
 	Reported by Mark Kettenis <kettenis@phys.uva.nl>.
 
 	* glibcbug.in: Fix @gnu.ai.mit.edu -> @gnu.org.
diff --git a/FAQ b/FAQ
index 14d1886d05..c37ae5b7ed 100644
--- a/FAQ
+++ b/FAQ
@@ -93,6 +93,10 @@ please let me know.
 
 [Q26]	``I have /usr/include/net and /usr/include/scsi as symlinks
 	  into my Linux source tree.  Is that wrong?''
+
+[Q27]	``Programs like `logname', `top', `uptime' `users', `w' and
+	  `who', show incorrect information about the (number of)
+	  users on my system.  Why?''
 
 ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
 [Q1]	``What systems does the GNU C Library run on?''
@@ -136,7 +140,9 @@ The GNU CC is found like all other GNU packages on
 or better one of the many mirror sites.
 
 You always should try to use the latest official release.  Older
-versions might not have all the features GNU libc could use.
+versions might not have all the features GNU libc could use.  It is
+known that on most platforms compilers earlier than 2.7.2.3 fail so
+at least use this version.
 
 
 ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
@@ -199,6 +205,9 @@ Library.
   <J.J.Troup@comp.brad.ac.uk> reports for a full build (shared, static,
   and profiled) a compile time of 45h34m.
 
+  For Atari TT030 (Motorola 68030 @ 32 Mhz, 34 Mb memory) (full build)
+  a compile time of 22h48m.
+
   If you have some more measurements let me know.
 
 * When compiling for Linux:
@@ -345,6 +354,9 @@ be read by functions from the other library.  Sorry, but this is what
 a major release is for.  It's better to have a cut now than having no
 means to support the new techniques later.
 
+{MK} There is however a (partial) solution for this problem.  Please
+take a look at the file `README.utmpd'.
+
 
 ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
 [Q11]	``Where are the DST_* constants found in <sys/time.h> on many
@@ -714,6 +726,14 @@ symlink that you have in place before you install glibc.  However,
 
 
 ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
+[Q27]	``Programs like `logname', `top', `uptime' `users', `w' and
+	  `who', show incorrect information about the (number of)
+	  users on my system.  Why?''
+
+[A27] {MK} See Q10.
+
+
+~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
 
 Answers were given by:
 {UD} Ulrich Drepper, <drepper@cygnus.com>
@@ -723,6 +743,7 @@ Answers were given by:
 {AJ} Andreas Jaeger, <aj@arthur.rhein-neckar.de>
 {EY} Eric Youngdale, <eric@andante.jic.com>
 {PB} Phil Blundell, <Philip.Blundell@pobox.com>
+{MK} Mark Kettenis, <kettenis@phys.uva.nl>
 
 Local Variables:
  mode:text
diff --git a/Makerules b/Makerules
index a554e2a9ec..cefd005d5d 100644
--- a/Makerules
+++ b/Makerules
@@ -679,7 +679,7 @@ ifndef subdir
 # What we install as libc.so for programs to link against is in fact a
 # link script.  It contains references for the various libraries we need.
 # The libc.so object is not complete since some functions are only defined
-# in libc.a and the dynamic linker is an etra object.
+# in libc.a and the dynamic linker is an extra object.
 install: $(inst_libdir)/libc.so
 $(inst_libdir)/libc.so: $(common-objpfx)libc.so$(libc.so-version) \
 			$(elfobjdir)/$(rtld-installed-name) \
@@ -690,7 +690,11 @@ $(inst_libdir)/libc.so: $(common-objpfx)libc.so$(libc.so-version) \
 	 echo '   The dynamic linker defines some functions used by $(<F),';\
 	 echo '	  but ld uses definitions from libc.a before examining the';\
 	 echo '   dependencies of $(<F) to find $(rtld-installed-name).  */';\
-	 echo 'GROUP ( $(^F) )') > $@.new
+	 echo 'GROUP ( $(slibdir)/libc.so$(libc.so-version)' \
+	      '$(slibdir)/$(rtld-installed-name)' \
+	      '$(libdir)/lib$(libc-name).a' \
+	      ')' > $@.new
+	mv -f $@.new $@
 	mv -f $@.new $@
 
 endif
diff --git a/NEWS b/NEWS
index d02e78465c..f616e82fda 100644
--- a/NEWS
+++ b/NEWS
@@ -4,7 +4,7 @@ Copyright (C) 1992, 93, 94, 95, 96, 97 Free Software Foundation, Inc.
 See the end for copying conditions.
 
 Please send GNU C library bug reports using the `glibcbug' script to
-<bugs@gnu.ai.mit.edu>.  Questions and suggestions should be send to
+<bugs@gnu.org>.  Questions and suggestions should be send to
 <bug-glibc@prep.ai.mit.edu>.
 
 Version 2.1
diff --git a/README.template b/README.template
index 682d322420..56873846cd 100644
--- a/README.template
+++ b/README.template
@@ -80,7 +80,7 @@ in the GNU C library, explaining how you can tell the library what
 facilities you want it to make available.
 
 We prefer to get bug reports sent using the `glibcbug' shell script which
-is install together with the rest of the GNU libc to <bugs@gnu.ai.mit.edu>.
+is install together with the rest of the GNU libc to <bugs@gnu.org>.
 Simply run this shell script and fill in the information.  Nevertheless
 you can still send bug reports to <bug-glibc@prep.ai.mit.edu> as normal
 electronic mails.
diff --git a/Rules b/Rules
index cd82a6e2bc..c36e2c30d6 100644
--- a/Rules
+++ b/Rules
@@ -75,7 +75,8 @@ $(common-objpfx)dummy.c:
 	echo 'void __dummy__ (void) { }' > $@
 $(common-objpfx)empty.c:
 	cp -f /dev/null $@
-common-generated := $(common-generated) dummy.o dummy.c empty.c empty.os
+common-generated += dummy.o dummy.c empty.c \
+		    $(addprefix empty,$(object-suffixes))
 
 # This makes all the auxiliary and test programs.
 
@@ -152,6 +153,13 @@ subdir_dist: dist
 generated: $(addprefix $(common-objpfx),$(common-generated)) \
 	$(addprefix $(objpfx),$(generated))
 
+define o-iterator-doit
+$(common-objpfx)empty$o: $(common-objpfx)empty.c $(before-compile);
+	$$(compile-command.c)
+endef
+object-suffixes-left := $(object-suffixes)
+include $(o-iterator)
+
 ifndef libc.so-version
 # Undefine this because it can't work when we libc.so is unversioned.
 static-only-routines =
@@ -163,21 +171,15 @@ ifdef static-only-routines
 $(static-only-routines:%=$(objpfx)%.os): %.os: $(common-objpfx)empty.os
 	rm -f $@
 	ln $< $@
-
-$(common-objpfx)empty.os: $(common-objpfx)empty.c $(before-compile)
-	$(compile-command.c)
 endif
 
 ifdef shared-only-routines
 # If we have versioned code we don't need the old versions in any of the
 # static libraries.
 define o-iterator-doit
-$(shared-only-routines:%=$(objpfx)%.$o): %.$o: $(common-objpfx)empty.$o
+$(shared-only-routines:%=$(objpfx)%$o): %$o: $(common-objpfx)empty$o;
 	rm -f $$@
 	ln $$< $$@
-
-$(common-objpfx)empty.$o: $(common-objpfx)empty.c $(before-compile)
-	$$(compile-command.c)
 endef
 object-suffixes-left := $(filter-out .os,$(object-suffixes))
 include $(o-iterator)
diff --git a/SNAP b/SNAP
new file mode 100644
index 0000000000..c1fc905f43
--- /dev/null
+++ b/SNAP
@@ -0,0 +1,285 @@
+			 GNU libc SNAPSHOT SYSTEM
+			    (general info)
+			   Updated 1997-9-26
+
+WHAT ARE GNU libc SNAPSHOTS
+---------------------------
+
+Snapshots are an "image" of the main glibc development tree, captured at a
+particular random instant in time.  When you use the snapshots, you should be
+able to maintain a local copy of libc that is no more than one day older than
+the official source tree used by the libc maintainers.
+
+The primary purpose of providing snapshots is to widen the group of motivated
+developers that would like to help test, debug, and enhance glibc, by providing
+you with access to the "latest and greatest" source.  This has several
+advantages, and several disadvantages.
+
+    First the advantages:
+
+    o	Once we have a large base of motivated testers using the snapshots,
+	this should provide good coverage across all currently supported
+	glibc hosts and targets.  If a new bug is introduced in glibc due to
+	fixing another bug or ongoing development, it should become
+	obvious much more quickly and get fixed before the next general
+	net release.  This should help to reduce the chances of glibc being
+	released to the general public with a major bug that went unnoticed
+	during the release cycle testing because they are machine dependent.
+	We hope to greatly improve glibc's stability and reliability by
+	involving more people and more execution environments in the
+	prerelease testing.
+
+    o	With access to the latest source, any diffs that you send to fix
+	bugs or add new features should be much easier for the glibc team
+	to merge into the official source base (after suitable review
+	of course).  This encourages us to merge your changes quicker,
+	while they are still "fresh".
+
+    o	Once your diffs are merged, you can obtain a new copy of glibc
+	containing your changes almost immediately.  Thus you do not
+	have to maintain local copies of your changes for any longer
+	than it takes to get them merged into the official source base.
+	This encourages you to send in changes quicker.
+
+    And the disadvantages:
+
+    o	The snapshot you get will be largely untested and of unknown quality.
+	It may fail to configure or compile.  It may have serious bugs.
+	You should always keep a copy of the last known working version
+	before updating to the current snapshot, or at least be able to
+	regenerate a working version if the latest snapshot is unusable
+	in your environment for some reason.
+
+	If a production version of glibc has a bug and a snapshot has the fix,
+	and you care about stability, you should put only the fix for that
+	particular problem into your production version.  Of course, if you
+	are eager to test glibc, you can use the snapshot versions in your
+	daily work, but users who have not been consulted about whether they
+	feel like testing glibc should generally have something which is at
+	least as bug free as the last released version.
+
+    o	Providing timely response to your questions, bug reports, and
+	submitted patches will require the glibc development team to allocate
+	time from an already thin time budget.  Please try to help us make
+	this time as productive as possible.  See the section below about
+	how to submit changes.
+
+
+WHO SHOULD TRY THE SNAPSHOTS
+----------------------------
+
+Remember, these are snapshots not tested versions.  So if you use
+these versions you should be able to
+
+    o	make sure your system stays usable
+
+    o	locate and hopefully fix problems
+
+    o	to port glibc to a new target yourself
+
+You should not use the snapshots if
+
+    o	your system is needed in a production environment which needs
+	stability
+
+    o	you expect us to fix your problems since you somehow depend on them.
+	You must be willing to fix the problems yourself, we don't want to
+	see "I have problems, fix this" messages.
+
+
+HOW TO GET THE SNAPSHOTS
+------------------------
+
+At the moment we provide a full snapshot weekly (every sunday), so
+that users getting a snapshot for the first time, or updating after
+a long period of not updating, can get the latest version in a single
+operation.  Along with the full snapshot, we will provide incremental
+diffs on a nearly daily basis (whenever code changes).  Each daily
+diff will be relative to the source tree after applying all previous
+daily diffs.  The daily diffs are for people who have relatively low
+bandwidth ftp or uucp connections.
+
+The files will be available via anonymous ftp from alpha.gnu.ai.mit.edu, in
+directory /gnu/libc and on linux.kernel.org in /pub/software/libs/glibc.  The
+directories should look something like:
+
+	libc-970921.tar.gz
+	libc-970917-970922.diff.gz
+	libc-970922-970925.diff.gz
+	.
+	.
+	.
+
+Please note that the snapshots on alpha.gnu.ai.mit.edu and on
+linux.kernel.org are not always in sync. Patches to some files might
+appear a day a diff earlier or later on alpha than on kernel. 
+Use always alpha or always kernel but don't mix them.
+
+There are sometimes additionally test releases of the add-ons available in
+these directories.  If a new version of an add-on is available it is normally
+required for the corresponding snapshot so always pay attention for these.
+
+Note that we provide GNU gzip compressed files only.  You can ftp gzip
+from prep.ai.mit.edu in directory pub/gnu.
+
+In some cases the dates for diffs and snapshots do not match like in the
+example above.  The full release is for 970921 but the patch is for
+970917-970922.  This only means that nothing changed between 970917 and 970922
+and that you have to use this patch on top of the 970921 snapshot since the
+patch is made on 970922.
+
+Also, as the gcc developers did with their gcc snapshot system, even though we
+will make the snapshots available on a publically accessible ftp area, we ask
+that recipients not widely publicise their availability.  The motivation for
+this request is not to hoard them, but to avoid the situation where the
+general glibc user base naively attempts to use the snapshots, has trouble with
+them, complains publically, and the reputation of glibc declines because of a
+perception of instability or lack of quality control.
+
+
+GLIBC TEST SUITE
+----------------
+
+A test suite is distributed as an integral part of the snapshots.  A simple
+"make check" in your build directory is sufficient to run the tests.  glibc
+should pass all tests and if any fails, please report it.  A failure might not
+originate from a bug in glibc but also from bugs in the tools, e.g. with gcc
+2.7.2.x the math tests fail some of the tests because of compiler bugs.
+
+Note that the test suite is still in its infancy.  The tests themselves only
+cover a small portion of libc features, and where tests do exist for a feature
+they are not exhaustive.  New tests are welcome.
+
+
+GETTING HELP, GLIBC DISCUSSIONS, etc
+------------------------------------
+
+People who want to help with glibc and who test out snapshots regularly should
+get on the libc-alpha@gnu.ai.mit.edu mailing list by sending an email to
+libc-alpha-request@gnu.ai.mit.edu.  This list is meant (as the name suggests)
+for the discussion of test releases and also reports for them.  People who are
+on this list are welcome to post questions of general interest.
+
+People who are not only willing to test the snapshots but instead really want
+to help developing glibc should contact libc-hacker-request@gnu.ai.mit.edu to
+be put on the developers mailing list.  This list is really only meant for
+developers.  No questions about installation problems or other simple topics
+are wanted nor will they be answered.
+
+Do *not* send any questions about the snapshots or patches specific to the
+snapshots to bug-glibc@prep.ai.mit.edu.  Nobody there will have any idea what
+you are talking about and it will just cause confusion.
+
+
+BUG REPORTS
+-----------
+
+Send bug reports directly to Ulrich Drepper <drepper@gnu.ai.mit.edu>.  Please
+do *not* use the glibcbug script for reporting bugs in the snapshots.
+glibcbug should only be used for problems with the official released versions.
+We don't like bug reports in the bug database because otherwise the impression
+of instability or lack of quality control of glibc as a whole might manifest
+in people's mind.
+
+Note that since no testing is done on the snapshots, and snapshots may even be
+made when glibc is in an inconsistent state, it may not be unusual for an
+occasional snapshot to have a very obvious bug, such as failure to compile on
+*any* machine.  It is likely that such bugs will be fixed by the next
+snapshot, so it really isn't necessary to report them unless they persist for
+a couple of days.
+
+Missing files should always be reported, since they usually mean there is a
+problem with the snapshot-generating process and we won't know about them
+unless someone tells us.
+
+Bugs which are non-obvious, such as failure to compile on only a specific
+machine, a new machine dependent or obscure bug (particularly one not detected
+by the testsuite), etc should be reported when you discover them, or have a
+suggested patch to fix them.
+
+
+FORMAT FOR PATCHES
+------------------
+
+If you have a fix for a bug, or an enhancement to submit, send your patch to
+Ulrich Drepper <drepper@gnu.ai.mit.edu>.  Here are some simple guidelines for
+submitting patches:
+
+    o	Use "unified diffs" for patches.  A typical command for generating
+	context diffs is "diff -ru glibc-old glibc-patched".
+
+    o	Use the "minimalist approach" for patches.  That is, each patch
+	should address only one particular bug, new feature, etc.  Do not
+	save up many unrelated changes and submit them all in one big
+	patch, since in general, the larger the patch the more difficult
+	it is for us to decide if the patch is either correct or
+	desirable.  And if we find something about the patch that needs
+	to be corrected before it can be installed, we would have to reject
+	the entire patch, which might contain changes which otherwise would
+	be accepted if submitted separately.
+
+    o	Submit a sample ChangeLog entry with your patch.  See the existing
+	glibc ChangeLog for examples of what a ChangeLog entry should look
+	like.  The emacs command ^X4A will create a ChangeLog entry header
+	for you.
+
+
+BUILDING SNAPSHOTS
+------------------
+
+The `best' way to build glibc is to use an extra directory, e.g.:
+tar xzf libc-970921.tar.gz
+mkdir build-glibc
+cd build-glibc
+../libc-970921/configure ...
+
+In this way you can easily clean up (since `make clean' doesn't work at
+the moment) and rebuild glibc.
+
+
+NECESSARY TOOLS
+---------------
+
+For the recommended versions of gcc, binutils, make, texinfo, gettext,
+autoconf and other tools which might be especially needed when using patches,
+please read the file INSTALL.
+
+
+HOW CAN YOU HELP
+----------------
+
+It helps already a lot if you just install glibc on your system and try to
+solve any problems.  You might want to look at the file `PROJECTS' and help
+with one of those projects, fix some bugs (see `BUGS' or the bug database),
+port to an unsupported platform, ...
+
+
+FURTHER DOCUMENTATION
+---------------------
+
+A lot of questions are answered in the FAQ.  The files `INSTALL', `README' and
+`NOTES' contain the most important documentation.  Furthermore glibc has its
+own 700+ pages info documentation, ...
+
+
+
+And finally a word of caution: The libc is one of the most fundamental parts
+of your system - and these snapshots are untested and come without any
+guarantee or warranty.  You might be lucky and everything works or you might
+crash your system.  If you install a glibc snapshot as primary library, you
+should have a backup somewhere.
+
+On many systems it is also a problem to replace the libc while the system is
+running.  In the worst case on broken OSes some systems crash.  On better
+systems you can move the old libc aside but removing it will cause problems
+since there are still processes using this libc image and so you might have to
+check the filesystem to get rid of the libc data.  One good alternative (which
+is also safer) is to use a chroot'ed environment.
+
+Thanks for your help and support.
+
+Thanks to Fred Fish from Cygnus for the original version of this text
+(for GDB).
+
+
+Ulrich Drepper
diff --git a/configure b/configure
index 029f2c8f01..3b1a1390e9 100755
--- a/configure
+++ b/configure
@@ -729,7 +729,12 @@ subdirs="$add_ons"
 add_ons_pfx=
 if test x"$add_ons" != x; then
   for f in $add_ons; do
-    add_ons_pfx="$add_ons_pfx $f/"
+    # Test whether such a subdir really exists.
+    if test -d $srcdir/$f; then
+      add_ons_pfx="$add_ons_pfx $f/"
+    else
+      { echo "configure: error: add-on directory \"$f\" does not exist" 1>&2; exit 1; }
+    fi
   done
 fi
 
@@ -755,7 +760,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:759: checking host system type" >&5
+echo "configure:764: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -874,7 +879,7 @@ fi
 # This can take a while to compute.
 sysdep_dir=$srcdir/sysdeps
 echo $ac_n "checking sysdep dirs""... $ac_c" 1>&6
-echo "configure:878: checking sysdep dirs" >&5
+echo "configure:883: checking sysdep dirs" >&5
 # Make sco3.2v4 become sco3.2.4 and sunos4.1.1_U1 become sunos4.1.1.U1.
 os="`echo $os | sed 's/\([0-9A-Z]\)[v_]\([0-9A-Z]\)/\1.\2/g'`"
 
@@ -1075,7 +1080,7 @@ echo "$ac_t""sysdeps/generic" 1>&6
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1079: checking for a BSD compatible install" >&5
+echo "configure:1084: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1129,7 +1134,7 @@ if test "$INSTALL" = "${srcdir}/install-sh -c"; then
   INSTALL='\$(..)./install-sh -c'
 fi
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1133: checking whether ln -s works" >&5
+echo "configure:1138: checking whether ln -s works" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1154,7 +1159,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1158: checking for $ac_word" >&5
+echo "configure:1163: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_MSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1187,7 +1192,7 @@ test -n "$MSGFMT" || MSGFMT=":"
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1191: checking for $ac_word" >&5
+echo "configure:1196: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1216,7 +1221,7 @@ if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1220: checking for $ac_word" >&5
+echo "configure:1225: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1264,7 +1269,7 @@ fi
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1268: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1273: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -1274,11 +1279,11 @@ ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS
 cross_compiling=$ac_cv_prog_cc_cross
 
 cat > conftest.$ac_ext <<EOF
-#line 1278 "configure"
+#line 1283 "configure"
 #include "confdefs.h"
 main(){return(0);}
 EOF
-if { (eval echo configure:1282: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1287: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1301,13 +1306,13 @@ else
  cross_linkable=yes
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1305: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1310: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1311: checking whether we are using GNU C" >&5
+echo "configure:1316: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1316,7 +1321,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1320: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1325: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1333,7 +1338,7 @@ if test $ac_cv_prog_gcc = yes; then
   yes;
 #endif
 EOF
-  if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1337: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+  if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1342: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
     if test -z "$CFLAGS"; then
       CFLAGS="-g -O2"
     fi
@@ -1345,7 +1350,7 @@ else
 fi
 
 echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:1349: checking build system type" >&5
+echo "configure:1354: checking build system type" >&5
 
 build_alias=$build
 case "$build_alias" in
@@ -1368,7 +1373,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1372: checking for $ac_word" >&5
+echo "configure:1377: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_BUILD_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1399,7 +1404,7 @@ done
 fi
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1403: checking how to run the C preprocessor" >&5
+echo "configure:1408: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -1414,13 +1419,13 @@ else
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 1418 "configure"
+#line 1423 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1424: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1429: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   :
@@ -1431,13 +1436,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 1435 "configure"
+#line 1440 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1441: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1446: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   :
@@ -1470,7 +1475,7 @@ LD=`$CC -print-file-name=ld`
 
 # Determine whether we are using GNU binutils.
 echo $ac_n "checking whether $AS is GNU as""... $ac_c" 1>&6
-echo "configure:1474: checking whether $AS is GNU as" >&5
+echo "configure:1479: checking whether $AS is GNU as" >&5
 if eval "test \"`echo '$''{'libc_cv_prog_as_gnu'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1488,7 +1493,7 @@ rm -f a.out
 gnu_as=$libc_cv_prog_as_gnu
 
 echo $ac_n "checking whether $LD is GNU ld""... $ac_c" 1>&6
-echo "configure:1492: checking whether $LD is GNU ld" >&5
+echo "configure:1497: checking whether $LD is GNU ld" >&5
 if eval "test \"`echo '$''{'libc_cv_prog_ld_gnu'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1512,7 +1517,7 @@ fi
 # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1516: checking for $ac_word" >&5
+echo "configure:1521: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1543,7 +1548,7 @@ fi
 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1547: checking for $ac_word" >&5
+echo "configure:1552: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1574,7 +1579,7 @@ if test -n "$ac_tool_prefix"; then
   # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1578: checking for $ac_word" >&5
+echo "configure:1583: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1609,7 +1614,7 @@ fi
 # Extract the first word of "bash", so it can be a program name with args.
 set dummy bash; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1613: checking for $ac_word" >&5
+echo "configure:1618: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_BASH'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1650,7 +1655,7 @@ if test "$BASH" = no; then
   # Extract the first word of "ksh", so it can be a program name with args.
 set dummy ksh; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1654: checking for $ac_word" >&5
+echo "configure:1659: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_KSH'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1696,7 +1701,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1700: checking for $ac_word" >&5
+echo "configure:1705: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1731,7 +1736,7 @@ test -n "$PERL" || PERL="no"
 
 
 echo $ac_n "checking for signed size_t type""... $ac_c" 1>&6
-echo "configure:1735: checking for signed size_t type" >&5
+echo "configure:1740: checking for signed size_t type" >&5
 if eval "test \"`echo '$''{'libc_cv_signed_size_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1755,12 +1760,12 @@ EOF
 fi
 
 echo $ac_n "checking for libc-friendly stddef.h""... $ac_c" 1>&6
-echo "configure:1759: checking for libc-friendly stddef.h" >&5
+echo "configure:1764: checking for libc-friendly stddef.h" >&5
 if eval "test \"`echo '$''{'libc_cv_friendly_stddef'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1764 "configure"
+#line 1769 "configure"
 #include "confdefs.h"
 #define __need_size_t
 #define __need_wchar_t
@@ -1775,7 +1780,7 @@ size_t size; wchar_t wchar;
 if (&size == NULL || &wchar == NULL) abort ();
 ; return 0; }
 EOF
-if { (eval echo configure:1779: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1784: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   libc_cv_friendly_stddef=yes
 else
@@ -1794,7 +1799,7 @@ override stddef.h = # The installed <stddef.h> seems to be libc-friendly."
 fi
 
 echo $ac_n "checking whether we need to use -P to assemble .S files""... $ac_c" 1>&6
-echo "configure:1798: checking whether we need to use -P to assemble .S files" >&5
+echo "configure:1803: checking whether we need to use -P to assemble .S files" >&5
 if eval "test \"`echo '$''{'libc_cv_need_minus_P'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1817,7 +1822,7 @@ asm-CPPFLAGS = -P # The assembler can't grok cpp's # line directives."
 fi
 
 echo $ac_n "checking for assembler global-symbol directive""... $ac_c" 1>&6
-echo "configure:1821: checking for assembler global-symbol directive" >&5
+echo "configure:1826: checking for assembler global-symbol directive" >&5
 if eval "test \"`echo '$''{'libc_cv_asm_global_directive'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1847,7 +1852,7 @@ EOF
 fi
 
 echo $ac_n "checking for .set assembler directive""... $ac_c" 1>&6
-echo "configure:1851: checking for .set assembler directive" >&5
+echo "configure:1856: checking for .set assembler directive" >&5
 if eval "test \"`echo '$''{'libc_cv_asm_set_directive'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1881,7 +1886,7 @@ EOF
 fi
 
 echo $ac_n "checking for .symver assembler directive""... $ac_c" 1>&6
-echo "configure:1885: checking for .symver assembler directive" >&5
+echo "configure:1890: checking for .symver assembler directive" >&5
 if eval "test \"`echo '$''{'libc_cv_asm_symver_directive'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1900,7 +1905,7 @@ fi
 
 echo "$ac_t""$libc_cv_asm_symver_directive" 1>&6
 echo $ac_n "checking for ld --version-script""... $ac_c" 1>&6
-echo "configure:1904: checking for ld --version-script" >&5
+echo "configure:1909: checking for ld --version-script" >&5
 if eval "test \"`echo '$''{'libc_cv_ld_version_script_option'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1919,7 +1924,7 @@ EOF
     if { ac_try='${CC-cc} $CFLAGS -shared -o conftest.so conftest.o
 					-nostartfiles -nostdlib
 					-Wl,--version-script,conftest.map
-		       1>&5'; { (eval echo configure:1923: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; };
+		       1>&5'; { (eval echo configure:1928: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; };
     then
       libc_cv_ld_version_script_option=yes
     else
@@ -1950,7 +1955,7 @@ fi
 
 if test $elf = yes; then
   echo $ac_n "checking for .previous assembler directive""... $ac_c" 1>&6
-echo "configure:1954: checking for .previous assembler directive" >&5
+echo "configure:1959: checking for .previous assembler directive" >&5
 if eval "test \"`echo '$''{'libc_cv_asm_previous_directive'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1958,7 +1963,7 @@ else
 .section foo_section
 .previous
 EOF
-  if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:1962: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+  if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:1967: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
     libc_cv_asm_previous_directive=yes
   else
     libc_cv_asm_previous_directive=no
@@ -1974,7 +1979,7 @@ EOF
 
   else
     echo $ac_n "checking for .popsection assembler directive""... $ac_c" 1>&6
-echo "configure:1978: checking for .popsection assembler directive" >&5
+echo "configure:1983: checking for .popsection assembler directive" >&5
 if eval "test \"`echo '$''{'libc_cv_asm_popsection_directive'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1982,7 +1987,7 @@ else
 .pushsection foo_section
 .popsection
 EOF
-    if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:1986: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+    if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:1991: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
       libc_cv_asm_popsection_directive=yes
     else
       libc_cv_asm_popsection_directive=no
@@ -2002,12 +2007,12 @@ fi
 
 if test $elf != yes; then
   echo $ac_n "checking for .init and .fini sections""... $ac_c" 1>&6
-echo "configure:2006: checking for .init and .fini sections" >&5
+echo "configure:2011: checking for .init and .fini sections" >&5
 if eval "test \"`echo '$''{'libc_cv_have_initfini'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2011 "configure"
+#line 2016 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -2016,7 +2021,7 @@ asm (".section .init");
 				    asm (".text");
 ; return 0; }
 EOF
-if { (eval echo configure:2020: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2025: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   libc_cv_have_initfini=yes
 else
@@ -2044,19 +2049,19 @@ if test $elf = yes; then
 else
   if test $ac_cv_prog_cc_works = yes; then
     echo $ac_n "checking for _ prefix on C symbol names""... $ac_c" 1>&6
-echo "configure:2048: checking for _ prefix on C symbol names" >&5
+echo "configure:2053: checking for _ prefix on C symbol names" >&5
 if eval "test \"`echo '$''{'libc_cv_asm_underscores'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2053 "configure"
+#line 2058 "configure"
 #include "confdefs.h"
 asm ("_glibc_foobar:");
 int main() {
 glibc_foobar ();
 ; return 0; }
 EOF
-if { (eval echo configure:2060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2065: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   libc_cv_asm_underscores=yes
 else
@@ -2071,17 +2076,17 @@ fi
 echo "$ac_t""$libc_cv_asm_underscores" 1>&6
   else
     echo $ac_n "checking for _ prefix on C symbol names""... $ac_c" 1>&6
-echo "configure:2075: checking for _ prefix on C symbol names" >&5
+echo "configure:2080: checking for _ prefix on C symbol names" >&5
 if eval "test \"`echo '$''{'libc_cv_asm_underscores'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2080 "configure"
+#line 2085 "configure"
 #include "confdefs.h"
 void underscore_test(void) {
 return; }
 EOF
-if { (eval echo configure:2085: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2090: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   if grep _underscore_test conftest* >/dev/null; then
     rm -f conftest*
     libc_cv_asm_underscores=yes
@@ -2114,7 +2119,7 @@ if test $elf = yes; then
   libc_cv_asm_weakext_directive=no
 else
   echo $ac_n "checking for assembler .weak directive""... $ac_c" 1>&6
-echo "configure:2118: checking for assembler .weak directive" >&5
+echo "configure:2123: checking for assembler .weak directive" >&5
 if eval "test \"`echo '$''{'libc_cv_asm_weak_directive'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2137,7 +2142,7 @@ echo "$ac_t""$libc_cv_asm_weak_directive" 1>&6
 
 if test $libc_cv_asm_weak_directive = no; then
   echo $ac_n "checking for assembler .weakext directive""... $ac_c" 1>&6
-echo "configure:2141: checking for assembler .weakext directive" >&5
+echo "configure:2146: checking for assembler .weakext directive" >&5
 if eval "test \"`echo '$''{'libc_cv_asm_weakext_directive'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2174,7 +2179,7 @@ EOF
 fi
 
 echo $ac_n "checking for ld --no-whole-archive""... $ac_c" 1>&6
-echo "configure:2178: checking for ld --no-whole-archive" >&5
+echo "configure:2183: checking for ld --no-whole-archive" >&5
 if eval "test \"`echo '$''{'libc_cv_ld_no_whole_archive'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2185,7 +2190,7 @@ __throw () {}
 EOF
 if { ac_try='${CC-cc} $CFLAGS
 			    -nostdlib -nostartfiles -Wl,--no-whole-archive
-			    -o conftest conftest.c 1>&5'; { (eval echo configure:2189: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+			    -o conftest conftest.c 1>&5'; { (eval echo configure:2194: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
   libc_cv_ld_no_whole_archive=yes
 else
   libc_cv_ld_no_whole_archive=no
@@ -2196,7 +2201,7 @@ fi
 echo "$ac_t""$libc_cv_ld_no_whole_archive" 1>&6
 
 echo $ac_n "checking for gcc -fno-exceptions""... $ac_c" 1>&6
-echo "configure:2200: checking for gcc -fno-exceptions" >&5
+echo "configure:2205: checking for gcc -fno-exceptions" >&5
 if eval "test \"`echo '$''{'libc_cv_gcc_no_exceptions'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2207,7 +2212,7 @@ __throw () {}
 EOF
 if { ac_try='${CC-cc} $CFLAGS
 			    -nostdlib -nostartfiles -fno-exceptions
-			    -o conftest conftest.c 1>&5'; { (eval echo configure:2211: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+			    -o conftest conftest.c 1>&5'; { (eval echo configure:2216: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
   libc_cv_gcc_no_exceptions=yes
 else
   libc_cv_gcc_no_exceptions=no
@@ -2218,12 +2223,12 @@ fi
 echo "$ac_t""$libc_cv_gcc_no_exceptions" 1>&6
 
 echo $ac_n "checking for DWARF2 unwind info support""... $ac_c" 1>&6
-echo "configure:2222: checking for DWARF2 unwind info support" >&5
+echo "configure:2227: checking for DWARF2 unwind info support" >&5
 if eval "test \"`echo '$''{'libc_cv_gcc_dwarf2_unwind_info'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.c <<EOF
-#line 2227 "configure"
+#line 2232 "configure"
 static char __EH_FRAME_BEGIN__;
 _start ()
 {
@@ -2244,7 +2249,7 @@ __bzero () {}
 EOF
 if { ac_try='${CC-cc} $CFLAGS
 			    -nostdlib -nostartfiles
-			    -o conftest conftest.c -lgcc >&5'; { (eval echo configure:2248: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+			    -o conftest conftest.c -lgcc >&5'; { (eval echo configure:2253: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
   libc_cv_gcc_dwarf2_unwind_info=yes
 else
   libc_cv_gcc_dwarf2_unwind_info=no
@@ -2302,7 +2307,7 @@ if test "$uname" = "sysdeps/generic"; then
   fi
 
   echo $ac_n "checking OS release for uname""... $ac_c" 1>&6
-echo "configure:2306: checking OS release for uname" >&5
+echo "configure:2311: checking OS release for uname" >&5
 if eval "test \"`echo '$''{'libc_cv_uname_release'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2324,7 +2329,7 @@ echo "$ac_t""$libc_cv_uname_release" 1>&6
   uname_release="$libc_cv_uname_release"
 
   echo $ac_n "checking OS version for uname""... $ac_c" 1>&6
-echo "configure:2328: checking OS version for uname" >&5
+echo "configure:2333: checking OS version for uname" >&5
 if eval "test \"`echo '$''{'libc_cv_uname_version'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2346,7 +2351,7 @@ else
 fi
 
 echo $ac_n "checking stdio selection""... $ac_c" 1>&6
-echo "configure:2350: checking stdio selection" >&5
+echo "configure:2355: checking stdio selection" >&5
 
 case $stdio in
 libio) cat >> confdefs.h <<\EOF
@@ -2358,7 +2363,7 @@ esac
 echo "$ac_t""$stdio" 1>&6
 
 echo $ac_n "checking ldap selection""... $ac_c" 1>&6
-echo "configure:2362: checking ldap selection" >&5
+echo "configure:2367: checking ldap selection" >&5
 
 case $add_ons in
 *ldap*)
diff --git a/configure.in b/configure.in
index ec87736095..3f810bd1a8 100644
--- a/configure.in
+++ b/configure.in
@@ -88,7 +88,12 @@ AC_CONFIG_SUBDIRS($add_ons)
 add_ons_pfx=
 if test x"$add_ons" != x; then
   for f in $add_ons; do
-    add_ons_pfx="$add_ons_pfx $f/"
+    # Test whether such a subdir really exists.
+    if test -d $srcdir/$f; then
+      add_ons_pfx="$add_ons_pfx $f/"
+    else
+      AC_MSG_ERROR(add-on directory \"$f\" does not exist)
+    fi
   done
 fi
 
diff --git a/db/makedb.c b/db/makedb.c
index 6f8694d7c7..c277da71e7 100644
--- a/db/makedb.c
+++ b/db/makedb.c
@@ -216,7 +216,7 @@ more_help (int key, const char *text, void *input)
     case ARGP_KEY_HELP_EXTRA:
       /* We print some extra information.  */
       return strdup (gettext ("\
-Report bugs using the `glibcbug' script to <bugs@gnu.ai.mit.edu>.\n"));
+Report bugs using the `glibcbug' script to <bugs@gnu.org>.\n"));
     default:
       break;
     }
diff --git a/dirent/scandir.c b/dirent/scandir.c
index ac625d89f3..58a2c7519d 100644
--- a/dirent/scandir.c
+++ b/dirent/scandir.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 93, 94, 95, 96, 97 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
@@ -46,6 +46,9 @@ scandir (dir, namelist, select, cmp)
       {
 	size_t dsize;
 
+	/* Ignore errors from select or readdir */
+	__set_errno (0);
+
 	if (i == vsize)
 	  {
 	    struct dirent **new;
diff --git a/elf/dl-addr.c b/elf/dl-addr.c
index d50cc4bf10..baa6df593e 100644
--- a/elf/dl-addr.c
+++ b/elf/dl-addr.c
@@ -33,7 +33,7 @@ _dl_addr (const void *address, Dl_info *info)
   /* Find the highest-addressed object that ADDRESS is not below.  */
   match = NULL;
   for (l = _dl_loaded; l; l = l->l_next)
-    if (addr >= l->l_addr && !match || match->l_addr < l->l_addr)
+    if (addr >= l->l_addr && (!match || match->l_addr < l->l_addr))
       match = l;
 
   if (match)
@@ -62,10 +62,11 @@ _dl_addr (const void *address, Dl_info *info)
   /* We assume that the string table follows the symbol table, because
      there is no way in ELF to know the size of the dynamic symbol table!!  */
   for (matchsym = NULL; (void *) symtab < (void *) strtab; ++symtab)
-    if (addr >= match->l_addr + symtab->st_value && !matchsym ||
-	matchsym->st_value < symtab->st_value &&
-	ELFW(ST_BIND) (symtab->st_info) == STB_GLOBAL ||
-	ELFW(ST_BIND) (symtab->st_info) == STB_WEAK)
+    if (addr >= match->l_addr + symtab->st_value
+	&& (!matchsym
+	    || (matchsym->st_value < symtab->st_value
+		&& (ELFW(ST_BIND) (symtab->st_info) == STB_GLOBAL
+		    || ELFW(ST_BIND) (symtab->st_info) == STB_WEAK))))
       matchsym = symtab;
 
   if (matchsym)
diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c
index c3a67ffcc6..2ec7e3a446 100644
--- a/elf/dl-lookup.c
+++ b/elf/dl-lookup.c
@@ -25,7 +25,6 @@
 
 #include "dl-hash.h"
 #include <dl-machine.h>
-#include <stdio-common/_itoa.h>
 
 #define VERSTAG(tag)	(DT_NUM + DT_PROCNUM + DT_VERSIONTAGIDX (tag))
 
diff --git a/elf/dl-minimal.c b/elf/dl-minimal.c
index a76e01dcb8..088c2331f6 100644
--- a/elf/dl-minimal.c
+++ b/elf/dl-minimal.c
@@ -146,7 +146,7 @@ __assert_fail (const char *assertion,
   char buf[64];
   buf[sizeof buf - 1] = '\0';
   _dl_sysdep_fatal ("BUG IN DYNAMIC LINKER ld.so: ",
-		    file, ": ", _itoa (line, buf + sizeof buf - 1, 10, 0),
+		    file, ": ", _itoa_word (line, buf + sizeof buf - 1, 10, 0),
 		    ": ", function ?: "", function ? ": " : "",
 		    "Assertion `", assertion, "' failed!\n",
 		    NULL);
@@ -161,7 +161,7 @@ __assert_perror_fail (int errnum,
   char buf[64];
   buf[sizeof buf - 1] = '\0';
   _dl_sysdep_fatal ("BUG IN DYNAMIC LINKER ld.so: ",
-		    file, ": ", _itoa (line, buf + sizeof buf - 1, 10, 0),
+		    file, ": ", _itoa_word (line, buf + sizeof buf - 1, 10, 0),
 		    ": ", function ?: "", function ? ": " : "",
 		    "Unexpected error: ", strerror (errnum), "\n", NULL);
 
diff --git a/elf/ldd.bash.in b/elf/ldd.bash.in
index 32a9405422..6f4da3d8f9 100644
--- a/elf/ldd.bash.in
+++ b/elf/ldd.bash.in
@@ -49,7 +49,7 @@ Written by Roland McGrath and Ulrich Drepper."
   -d, --data-relocs       process data relocations
   -r, --function-relocs   process data and function relocations
   -v, --verbose           print all information
-Report bugs using the \`glibcbug' script to <bugs@gnu.ai.mit.edu>."
+Report bugs using the \`glibcbug' script to <bugs@gnu.org>."
     exit 0 ;;
   -d | --d | --da | --dat | --data | --data- | --data-r | --data-re | \
   --data-rel | --data-relo | --data-reloc | --data-relocs)
@@ -88,7 +88,7 @@ case $# in
 1)
   # We don't list the file name when there is only one.
   case "$1" in
-  /*) file="$1" ;;
+  */*) file="$1" ;;
   *) file="./$1" ;;
   esac
   if test ! -f "$file"; then
@@ -124,7 +124,7 @@ case $# in
   for file; do
     echo "${file}:"
     case "$file" in
-    /*) : ;;
+    */*) : ;;
     *) file="./$file" ;;
     esac
     if test ! -f "$file"; then
diff --git a/elf/ldd.sh.in b/elf/ldd.sh.in
index 908a26e269..1de55f4d39 100644
--- a/elf/ldd.sh.in
+++ b/elf/ldd.sh.in
@@ -44,7 +44,7 @@ Written by Roland McGrath and Ulrich Drepper.'
   -d, --data-relocs       process data relocations
   -r, --function-relocs   process data and function relocations
   -v, --verbose           print all information
-Report bugs using the \`glibcbug' script to <bugs@gnu.ai.mit.edu>."
+Report bugs using the \`glibcbug' script to <bugs@gnu.org>."
     exit 0 ;;
   -d | --d | --da | --dat | --data | --data- | --data-r | --data-re | \
   --data-rel | --data-relo | --data-reloc | --data-relocs)
@@ -85,7 +85,7 @@ Try \`ldd --help' for more information."
 1)
   # We don't list the file name when there is only one.
   case "$1" in
-  /*) file="$1" ;;
+  */*) file="$1" ;;
   *) file="./$1" ;;
   esac
   if test ! -f "$file"; then
@@ -124,7 +124,7 @@ Try \`ldd --help' for more information."
   for file; do
     echo "${file}:"
     case "$file" in
-    /*) : ;;
+    */*) : ;;
     *) file="./$file" ;;
     esac
     if test ! -f "$file"; then
diff --git a/elf/rtld.c b/elf/rtld.c
index 0402727c52..48d8575c89 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -656,7 +656,7 @@ of this helper program; chances are you did not intend to run this program.\n",
 	      {
 		char buf[20], *bp;
 		buf[sizeof buf - 1] = '\0';
-		bp = _itoa (l->l_addr, &buf[sizeof buf - 1], 16, 0);
+		bp = _itoa_word (l->l_addr, &buf[sizeof buf - 1], 16, 0);
 		while ((size_t) (&buf[sizeof buf - 1] - bp)
 		       < sizeof l->l_addr * 2)
 		  *--bp = '0';
@@ -675,12 +675,12 @@ of this helper program; chances are you did not intend to run this program.\n",
 						     ELF_MACHINE_JMP_SLOT);
 	    char buf[20], *bp;
 	    buf[sizeof buf - 1] = '\0';
-	    bp = _itoa (ref->st_value, &buf[sizeof buf - 1], 16, 0);
+	    bp = _itoa_word (ref->st_value, &buf[sizeof buf - 1], 16, 0);
 	    while ((size_t) (&buf[sizeof buf - 1] - bp) < sizeof loadbase * 2)
 	      *--bp = '0';
 	    _dl_sysdep_message (_dl_argv[i], " found at 0x", bp, NULL);
 	    buf[sizeof buf - 1] = '\0';
-	    bp = _itoa (loadbase, &buf[sizeof buf - 1], 16, 0);
+	    bp = _itoa_word (loadbase, &buf[sizeof buf - 1], 16, 0);
 	    while ((size_t) (&buf[sizeof buf - 1] - bp) < sizeof loadbase * 2)
 	      *--bp = '0';
 	    _dl_sysdep_message (" in object at 0x", bp, "\n", NULL);
diff --git a/intl/locale.alias b/intl/locale.alias
index e685298ee6..3426ce98e3 100644
--- a/intl/locale.alias
+++ b/intl/locale.alias
@@ -24,7 +24,7 @@
 # Note: This file is far from being complete.  If you have a value for
 # your own site which you think might be useful for others too, share
 # it with the rest of us.  Send it using the `glibcbug' script to
-# bugs@gnu.ai.mit.edu.
+# bugs@gnu.org.
 
 czech		cs_CZ.ISO-8859-2
 danish          da_DK.ISO-8859-1
diff --git a/io/ftwtest-sh b/io/ftwtest-sh
index 16dc1e1d47..508c850d4b 100644
--- a/io/ftwtest-sh
+++ b/io/ftwtest-sh
@@ -107,19 +107,23 @@ chmod -R a+x $tmpdir
 LD_LIBRARY_PATH=$objpfx $ldso $testprogram --chdir $tmpdir |
     sort > $testout
 
+# perhaps $tmp involves some symlinks...
+pwdprogram=`which pwd`
+tmpreal=`( cd $tmp ; $pwdprogram )`
+
 cat <<EOF | cmp $testout - || exit 1
-base = "$tmp/", file = "ftwtest.d", flag = FTW_D, cwd = $tmp, level = 0
-base = "$tmp/ftwtest.d/", file = "bar", flag = FTW_D, cwd = $tmp/ftwtest.d, level = 1
-base = "$tmp/ftwtest.d/", file = "baz", flag = FTW_F, cwd = $tmp/ftwtest.d, level = 1
-base = "$tmp/ftwtest.d/", file = "foo", flag = FTW_D, cwd = $tmp/ftwtest.d, level = 1
-base = "$tmp/ftwtest.d/bar/", file = "xo", flag = FTW_F, cwd = $tmp/ftwtest.d/bar, level = 2
-base = "$tmp/ftwtest.d/foo/", file = "lvl1", flag = FTW_D, cwd = $tmp/ftwtest.d/foo, level = 2
-base = "$tmp/ftwtest.d/foo/lvl1/", file = "file@1", flag = FTW_F, cwd = $tmp/ftwtest.d/foo/lvl1, level = 3
-base = "$tmp/ftwtest.d/foo/lvl1/", file = "link@1", flag = FTW_SLN, cwd = $tmp/ftwtest.d/foo/lvl1, level = 3
-base = "$tmp/ftwtest.d/foo/lvl1/", file = "lvl2", flag = FTW_D, cwd = $tmp/ftwtest.d/foo/lvl1, level = 3
-base = "$tmp/ftwtest.d/foo/lvl1/lvl2/", file = "file@2", flag = FTW_F, cwd = $tmp/ftwtest.d/foo/lvl1/lvl2, level = 4
-base = "$tmp/ftwtest.d/foo/lvl1/lvl2/", file = "lvl3", flag = FTW_D, cwd = $tmp/ftwtest.d/foo/lvl1/lvl2, level = 4
-base = "$tmp/ftwtest.d/foo/lvl1/lvl2/lvl3/", file = "file@3", flag = FTW_F, cwd = $tmp/ftwtest.d/foo/lvl1/lvl2/lvl3, level = 5
+base = "$tmp/", file = "ftwtest.d", flag = FTW_D, cwd = $tmpreal, level = 0
+base = "$tmp/ftwtest.d/", file = "bar", flag = FTW_D, cwd = $tmpreal/ftwtest.d, level = 1
+base = "$tmp/ftwtest.d/", file = "baz", flag = FTW_F, cwd = $tmpreal/ftwtest.d, level = 1
+base = "$tmp/ftwtest.d/", file = "foo", flag = FTW_D, cwd = $tmpreal/ftwtest.d, level = 1
+base = "$tmp/ftwtest.d/bar/", file = "xo", flag = FTW_F, cwd = $tmpreal/ftwtest.d/bar, level = 2
+base = "$tmp/ftwtest.d/foo/", file = "lvl1", flag = FTW_D, cwd = $tmpreal/ftwtest.d/foo, level = 2
+base = "$tmp/ftwtest.d/foo/lvl1/", file = "file@1", flag = FTW_F, cwd = $tmpreal/ftwtest.d/foo/lvl1, level = 3
+base = "$tmp/ftwtest.d/foo/lvl1/", file = "link@1", flag = FTW_SLN, cwd = $tmpreal/ftwtest.d/foo/lvl1, level = 3
+base = "$tmp/ftwtest.d/foo/lvl1/", file = "lvl2", flag = FTW_D, cwd = $tmpreal/ftwtest.d/foo/lvl1, level = 3
+base = "$tmp/ftwtest.d/foo/lvl1/lvl2/", file = "file@2", flag = FTW_F, cwd = $tmpreal/ftwtest.d/foo/lvl1/lvl2, level = 4
+base = "$tmp/ftwtest.d/foo/lvl1/lvl2/", file = "lvl3", flag = FTW_D, cwd = $tmpreal/ftwtest.d/foo/lvl1/lvl2, level = 4
+base = "$tmp/ftwtest.d/foo/lvl1/lvl2/lvl3/", file = "file@3", flag = FTW_F, cwd = $tmpreal/ftwtest.d/foo/lvl1/lvl2/lvl3, level = 5
 EOF
 rm $testout
 
diff --git a/libio/genops.c b/libio/genops.c
index f8342776f5..20d0df2d89 100644
--- a/libio/genops.c
+++ b/libio/genops.c
@@ -710,7 +710,6 @@ _IO_cleanup ()
   _IO_unbuffer_all ();
 }
 
-_IO_FILE *_IO_list_all = &_IO_stderr_.plus.file;
 
 void
 _IO_init_marker (marker, fp)
diff --git a/libio/iofdopen.c b/libio/iofdopen.c
index 841e7032b8..b6508255d0 100644
--- a/libio/iofdopen.c
+++ b/libio/iofdopen.c
@@ -42,7 +42,7 @@ _IO_fdopen (fd, mode)
   int posix_mode = 0;
   struct locked_FILE
   {
-    struct _IO_FILE_plus fp;
+    struct _IO_FILE_complete fp;
 #ifdef _IO_MTSAFE_IO
     _IO_lock_t lock;
 #endif
@@ -106,24 +106,24 @@ _IO_fdopen (fd, mode)
   if (new_f == NULL)
     return NULL;
 #ifdef _IO_MTSAFE_IO
-  new_f->fp.file._lock = &new_f->lock;
+  new_f->fp.plus.file._lock = &new_f->lock;
 #endif
-  _IO_init (&new_f->fp.file, 0);
-  _IO_JUMPS (&new_f->fp.file) = &_IO_file_jumps;
-  _IO_file_init (&new_f->fp.file);
+  _IO_init (&new_f->fp.plus.file, 0);
+  _IO_JUMPS (&new_f->fp.plus.file) = &_IO_file_jumps;
+  _IO_file_init (&new_f->fp.plus.file);
 #if  !_IO_UNIFIED_JUMPTABLES
   new_f->fp.vtable = NULL;
 #endif
-  if (_IO_file_attach (&new_f->fp.file, fd) == NULL)
+  if (_IO_file_attach (&new_f->fp.plus.file, fd) == NULL)
     {
-      _IO_un_link (&new_f->fp.file);
+      _IO_un_link (&new_f->fp.plus.file);
       free (new_f);
       return NULL;
     }
-  new_f->fp.file._flags &= ~_IO_DELETE_DONT_CLOSE;
+  new_f->fp.plus.file._flags &= ~_IO_DELETE_DONT_CLOSE;
 
-  new_f->fp.file._IO_file_flags =
-    _IO_mask_flags (&new_f->fp.file, read_write,
+  new_f->fp.plus.file._IO_file_flags =
+    _IO_mask_flags (&new_f->fp.plus.file, read_write,
 		    _IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING);
 
   return (_IO_FILE *) &new_f->fp;
diff --git a/libio/iopopen.c b/libio/iopopen.c
index f0589bf184..65337f8f28 100644
--- a/libio/iopopen.c
+++ b/libio/iopopen.c
@@ -74,7 +74,7 @@ extern int _IO_dup2 __P ((int fd, int fd2));
 
 struct _IO_proc_file
 {
-  struct _IO_FILE_plus file;
+  struct _IO_FILE_complete file;
   /* Following fields must match those in class procbuf (procbuf.h) */
   _IO_pid_t pid;
   struct _IO_proc_file *next;
@@ -169,7 +169,7 @@ _IO_popen (command, mode)
   if (new_f == NULL)
     return NULL;
 #ifdef _IO_MTSAFE_IO
-  new_f->fpx.file.file._lock = &new_f->lock;
+  new_f->fpx.file.plus.file._lock = &new_f->lock;
 #endif
   fp = (_IO_FILE*)&new_f->fpx;
   _IO_init (fp, 0);
diff --git a/libio/iovdprintf.c b/libio/iovdprintf.c
index a24d3b535e..04b40e7553 100644
--- a/libio/iovdprintf.c
+++ b/libio/iovdprintf.c
@@ -32,35 +32,35 @@ _IO_vdprintf (d, format, arg)
      const char *format;
      _IO_va_list arg;
 {
-  struct _IO_FILE_plus tmpfil;
+  struct _IO_FILE_complete tmpfil;
 #ifdef _IO_MTSAFE_IO
   _IO_lock_t lock;
 #endif
   int done;
 
 #ifdef _IO_MTSAFE_IO
-  tmpfil.file._lock = &lock;
+  tmpfil.plus.file._lock = &lock;
 #endif
-  _IO_init (&tmpfil.file, 0);
-  _IO_JUMPS (&tmpfil.file) = &_IO_file_jumps;
-  _IO_file_init (&tmpfil.file);
+  _IO_init (&tmpfil.plus.file, 0);
+  _IO_JUMPS (&tmpfil.plus.file) = &_IO_file_jumps;
+  _IO_file_init (&tmpfil.plus.file);
 #if  !_IO_UNIFIED_JUMPTABLES
   tmpfil.vtable = NULL;
 #endif
-  if (_IO_file_attach (&tmpfil.file, d) == NULL)
+  if (_IO_file_attach (&tmpfil.plus.file, d) == NULL)
     {
-      _IO_un_link (&tmpfil.file);
+      _IO_un_link (&tmpfil.plus.file);
       return EOF;
     }
-  tmpfil.file._flags &= ~_IO_DELETE_DONT_CLOSE;
+  tmpfil.plus.file._flags &= ~_IO_DELETE_DONT_CLOSE;
 
-  tmpfil.file._IO_file_flags =
-    _IO_mask_flags (&tmpfil.file, _IO_NO_READS,
+  tmpfil.plus.file._IO_file_flags =
+    _IO_mask_flags (&tmpfil.plus.file, _IO_NO_READS,
 		    _IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING);
 
-  done = _IO_vfprintf (&tmpfil.file, format, arg);
+  done = _IO_vfprintf (&tmpfil.plus.file, format, arg);
 
-  _IO_FINISH (&tmpfil.file);
+  _IO_FINISH (&tmpfil.plus.file);
 
   return done;
 }
diff --git a/libio/libioP.h b/libio/libioP.h
index 97c3206c4d..a90a604e53 100644
--- a/libio/libioP.h
+++ b/libio/libioP.h
@@ -273,7 +273,7 @@ struct _IO_FILE_plus
    same.  */
 struct _IO_FILE_complete
 {
-  struct _IO_FILE_plus plus;;
+  struct _IO_FILE_plus plus;
   _IO_off64_t _offset;
   int _unused2[16];	/* Make sure we don't get into trouble again.  */
 };
diff --git a/libio/stdfiles.c b/libio/stdfiles.c
index c563f2aed0..56861666af 100644
--- a/libio/stdfiles.c
+++ b/libio/stdfiles.c
@@ -51,7 +51,7 @@ DEF_STDFILE(_IO_new_stdout_, _IO_stdout_, 1, &_IO_stdin_.plus.file,
 DEF_STDFILE(_IO_new_stderr_, _IO_stderr_, 2, &_IO_stdout_.plus.file,
             _IO_NO_READS+_IO_UNBUFFERED);
 
+_IO_FILE *_IO_list_all = &_IO_stderr_.plus.file;
 #if 0
-_IO_FILE *_IO_new_list_all = &_IO_stderr_.plus.file;
 default_symbol_version (_IO_new_list_all, _IO_list_all, GLIBC_2.1);
 #endif
diff --git a/libio/stdio.c b/libio/stdio.c
index c8b3ba5a00..d38379f821 100644
--- a/libio/stdio.c
+++ b/libio/stdio.c
@@ -26,9 +26,6 @@
 #include "libioP.h"
 #include "stdio.h"
 
-/* Define non-macro versions of stdin/stdout/stderr, for use by
-   debuggers.  */
-
 #undef stdin
 #undef stdout
 #undef stderr
diff --git a/libio/stdio.h b/libio/stdio.h
index a835fed6cc..da796ecbe4 100644
--- a/libio/stdio.h
+++ b/libio/stdio.h
@@ -127,11 +127,9 @@ extern void __libc_fatal __P ((__const char *__message))
 
 
 /* Standard streams.  */
-extern FILE *stdin, *stdout, *stderr;
-/* Refer to the real names by default.  */
-#define stdin _IO_stdin
-#define stdout _IO_stdout
-#define stderr _IO_stderr
+extern FILE *stdin;		/* Standard input stream.  */
+extern FILE *stdout;		/* Standard output stream.  */
+extern FILE *stderr;		/* Standard error output stream.  */
 
 
 /* Remove file FILENAME.  */
diff --git a/login/Makefile b/login/Makefile
index 407330707b..3842b2f4af 100644
--- a/login/Makefile
+++ b/login/Makefile
@@ -32,7 +32,7 @@ install-sbin = utmpd
 utmpd-routines := connection database error request xtmp
 extra-objs := $(utmpd-routines:=.o)
 
-distribute := utmp-private.h programs/xtmp.h programs/utmpd.h \
+distribute := utmp-private.h programs/xtmp.h programs/utmpd.h README.utmpd \
 	      programs/utmpd-private.h $(utmpd-routines:%=programs/%.c)
 
 subdir-dirs = programs
diff --git a/login/README.utmpd b/login/README.utmpd
new file mode 100644
index 0000000000..d70b3d8de2
--- /dev/null
+++ b/login/README.utmpd
@@ -0,0 +1,174 @@
+With the introduction of version 2 of the GNU C Library the format of
+the UTMP and WTMP files changed for some configurations (see Q&A 10 of
+the FAQ).  This version of the GNU C Library contains a solution for
+the problems this may cause, by providing an UTMP daemon `utmpd'.
+
+Do I need it?
+=============
+
+If your configuration is one of the following:
+
+                i[3456]86-*-linux-gnu    Linux-2.0 on Intel
+                m68k-*-linux-gnu         Linux-2.0 on Motorola 680x0
+
+you might need it, so please read on.  If it is not, please read the
+section titled `Programming' at the end of this text.
+
+In principle, you only need the daemon if you want to keep using old
+programs linked against the previous version of the Linux C Library
+(libc5).  In addition you will need the daemon if you are running
+Linux on Intel, and you are planning to use iBCS (Intel Binary
+Compatibility Standard).  If you have no libc5 programs left on your
+system and you are not using iBCS, it is probably better not to
+install the daemon since it uses (a small amount of) memory and CPU
+time.  But apart from that it shouldn't hurt to install `utmpd', so
+when in doubt install it anyway.
+
+
+Installation
+============
+
+The installation process (`make install') already places the `utmpd'
+binary in $(sbindir).  The only thing you have to do is modifying your
+startup scripts to start the daemon.  Unfortunately this is a bit of a
+hassle, since the layout of these scripts is not standardized.  You
+should try to find the command that creates the file `/var/run/utmp'.
+This is usually done in a script named `/etc/rc', `/etc/init.d/boot'
+(Debian) or `/etc/rc.d/rc.S' (Slackware).  You could try:
+
+     grep utmp /etc/* /etc/init.d/* /etc/rc.d/*
+
+to find the right script.  The creation of `/var/run/utmp' is usually
+done with a command like:
+
+     : > /var/run/utmp
+
+or
+
+     cat /dev/null > /var/run/utmp
+
+Now add a line before this command to create the file `/var/run/utmpx'
+e.g.
+
+     : > /var/run/utmpx
+
+or
+
+     cat /dev/null > /var/run/utmpx
+
+whatever you prefer, and after this command, add a line to start the
+daemon
+
+     utmpd
+
+The entire fragment could look something like
+
+     # Clean up /var/run and create /var/run/utmp so that we can login.
+     ( cd /var/run && find . ! -type d -exec rm -f -- {} \; )
+     : > /var/run/utmpx
+     : > /var/run/utmp
+     utmpd
+
+If the file `/var/log/wtmp' exists on your system, you will probably
+want to create the file `/var/log/wtmpx'.  Programs linked against the
+GNU C Library will now write to `/var/log/wtmpx', while programs
+linked against the old library will continue to write to
+`/var/log/wtmp'.  Of course this means that the information gets
+spread over two files.  We hope to provide a better solution in the
+future.
+
+After a reboot, user accounting should be working again.  If not,
+please refer to the section titled `Troubleshooting' below before
+submitting a bug report.
+
+
+What is `utmpd' doing?
+======================
+
+After installation there will be two files that store the user
+accounting information: `/var/run/utmp' and `/var/run/utmpx'.  The
+file `/var/run/utmp' will be in the old format so libc5 programs will
+continue to work (even if they are broken and do not use the library
+functions to access the user accounting database).  And on Intel, you
+can safely link `/var/run/utmp' to `/etc/utmp' for iBCS programs.
+Programs linked against the new GNU C Library (glibc2) will contact
+the daemon for all user accounting database access.  The daemon will
+store its information in `/var/run/utmpx' and keeps this file in sync
+with `/var/run/utmp'.  Entries added to `/var/run/utmpx' will be
+converted to the old format and will be added to `/var/run/utmp' and
+vice versa.  This way both libc5 and glibc2 see the same information
+in the same fields of `struct utmp'. Of course libc5 programs see only
+part of the information that glibc2 programs see because not all
+members of the glibc2 `struct utmp' are present in the libc5 `struct
+utmp'.  For the same reason libc5 will see a truncated version of
+those fields where the length of the glibc2 field is larger than the
+corresponding libc5 field (ut_user, ut_line, ut_host).
+
+
+Troubleshooting
+===============
+
+If user accounting is not working on your system, e.g. programs like
+`who' or `logname' return rubbish, or you cannot login, make
+sure that:
+
+*  The file `/var/run/utmpx' exists.
+
+*  The file `/var/log/wtmpx' exists.
+
+*  No program linked against the GNU C Library (libc6) is accessing
+   `/var/run/utmp' directly (see the section on `Programming' below).
+
+If that does not solve your problems, please use the `glibcbug' script
+to report the problem to <bugs@gnu.org>.
+
+The `utmpd' daemon uses `syslogd' to report problems.  It uses the
+`daemon' facility and `warning' and `error' levels.  Alternatively you
+could use the following option to ease debugging:
+
+`--debug'
+    Use this option if you want the daemon to output its warnings and
+    error messages to the terminal instead of sending them to the
+    system logger (`syslogd').  When using this option the daemon does
+    not auto-background itself.
+
+To use this option you should first kill the daemon that is already
+running, and start a fresh one with the desired option:
+
+    kill `cat /var/run/utmpd.pid`
+    utmpd --debug
+
+Please include any warnings or error messages from `utmpd' in your
+bug reports.
+
+
+Programming
+===========
+
+In order for the `utmpd' approach to work it is essential that NO
+program EVER accesses the UTMP and WTMP files directly.  Instead, a
+program should use ONLY the available library functions:
+
+     * utmpname()	Select the database used (UTMP, WTMP, ...).
+     * setutent()	Open the database.
+     * getutent()	Read the next entry from the database.
+     * getutid()	Search for the next entry with a specific ID.
+     * getutline()	Search for the next entry for a specific line.
+     * pututline()	Write an entry to the database.
+     * endutent()	Close the database.
+     * updwtmp()	Add an entry to a database (WTMP, ...).
+
+For details, please refer to `The GNU C Library Reference Manual',
+which also contains information about some additional functions
+derived from BSD and XPG that may be of interest.  The command
+
+    info libc "User Accounting Database"
+
+should point you at the right location.
+
+If you encounter a program that reads from or, even worse, writes to
+the UTMP and WTMP files directly, please report this as a bug to the
+author of that program.  Note that the files referred to by the macros
+`_PATH_UTMP' and `_PATH_WTMP' might even disappear in the future, so
+please do not use these, except in a call to `utmpname()' or
+`updwtmp()', not even to check their existence.
diff --git a/login/programs/utmpd.c b/login/programs/utmpd.c
index e0648ebb42..c2e9fe0a8b 100644
--- a/login/programs/utmpd.c
+++ b/login/programs/utmpd.c
@@ -144,7 +144,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
   /* Cleanup files created by a previous `bind'.  */
   unlink (_PATH_UTMPD_RO);
   unlink (_PATH_UTMPD_RW);
-  
+
   /* Open UTMP database.  */
   utmp_db = open_database (_PATH_UTMP "x", _PATH_UTMP);
   if (utmp_db == NULL)
@@ -205,7 +205,7 @@ Usage: %s [OPTION]...\n\
   -V, --version         output version information and exit\n"),
 	      program_invocation_name);
       fputs (_("\
-Report bugs using the `glibcbug' script to <bugs@gnu.ai.mit.edu>.\n"),
+Report bugs using the `glibcbug' script to <bugs@gnu.org>.\n"),
 	     stdout);
     }
 
@@ -252,7 +252,7 @@ make_socket (const char *name)
   size = (offsetof (struct sockaddr_un, sun_path)
 	  + strlen (addr.sun_path));
 
-  
+
   if (bind (sock, (struct sockaddr *) &addr, size) < 0)
     error (EXIT_FAILURE, errno, "%s", name);
 
diff --git a/malloc/malloc.c b/malloc/malloc.c
index 06fbf844f4..e5c3c64b15 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -1750,11 +1750,11 @@ static int dev_zero_fd = -1; /* Cached file descriptor for /dev/zero. */
 
 #endif
 
-static mchunkptr
 #if defined __GNUC__ && __GNUC__ >= 2
 /* This function is only called from one place, inline it.  */
 inline
 #endif
+static mchunkptr
 internal_function
 #if __STD_C
 mmap_chunk(size_t size)
@@ -2286,11 +2286,11 @@ arena *ar_ptr; mchunkptr p; INTERNAL_SIZE_T s;
   Main interface to sbrk (but see also malloc_trim).
 */
 
-static void
 #if defined __GNUC__ && __GNUC__ >= 2
 /* This function is called only from one place, inline it.  */
 inline
 #endif
+static void
 internal_function
 #if __STD_C
 malloc_extend_top(arena *ar_ptr, INTERNAL_SIZE_T nb)
diff --git a/malloc/obstack.h b/malloc/obstack.h
index 49492eb73c..e7ae6959e5 100644
--- a/malloc/obstack.h
+++ b/malloc/obstack.h
@@ -498,7 +498,7 @@ __extension__								\
  (unsigned) ((h)->chunk_limit - (h)->next_free)
 
 #define obstack_empty_p(h) \
- (h->chunk->prev == 0 && h->next_free - h->chunk->contents == 0)
+ ((h)->chunk->prev == 0 && (h)->next_free - (h)->chunk->contents == 0)
 
 /* Note that the call to _obstack_newchunk is enclosed in (..., 0)
    so that we can avoid having void expressions
diff --git a/malloc/thread-m.h b/malloc/thread-m.h
index 24d95dfb31..f9367c6782 100644
--- a/malloc/thread-m.h
+++ b/malloc/thread-m.h
@@ -19,7 +19,8 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-/* One out of _LIBC, USE_PTHREADS, USE_THR or USE_SPROC should be
+/* $Id$
+   One out of _LIBC, USE_PTHREADS, USE_THR or USE_SPROC should be
    defined, otherwise the token NO_THREADS and dummy implementations
    of the macros will be defined.  */
 
@@ -40,23 +41,18 @@ typedef pthread_t thread_id;
 typedef pthread_mutex_t	mutex_t;
 
 /* thread specific data */
-typedef pthread_key_t tsd_key_t;
+typedef void * tsd_key_t;
 
 #define MUTEX_INITIALIZER	PTHREAD_MUTEX_INITIALIZER
 
-static Void_t *malloc_key_data;
-
-#define tsd_key_create(key, destr) \
-  if (__pthread_key_create != NULL) {					      \
-    __pthread_key_create(key, destr);					      \
-  } else { *(key) = (tsd_key_t) 0; }
+#define tsd_key_create(key, destr) ( *(key) = NULL )
 #define tsd_setspecific(key, data) \
-  if (__pthread_setspecific != NULL) {					      \
-    __pthread_setspecific(key, data);					      \
-  } else { malloc_key_data = (Void_t *) data; }
+  if (__libc_internal_tsd_set != NULL) {				      \
+    __libc_internal_tsd_set(_LIBC_TSD_KEY_MALLOC, data);		      \
+  } else { (key) = (Void_t *) data; }
 #define tsd_getspecific(key, vptr) \
-  (vptr = (__pthread_getspecific != NULL				      \
-	   ? __pthread_getspecific(key) : malloc_key_data))
+  (vptr = (__libc_internal_tsd_get != NULL				      \
+	   ? __libc_internal_tsd_get(_LIBC_TSD_KEY_MALLOC) : (key)))
 
 #define mutex_init(m)		\
    (__pthread_mutex_init != NULL ? __pthread_mutex_init (m, NULL) : 0)
@@ -131,12 +127,33 @@ typedef pthread_mutex_t mutex_t;
 #define mutex_unlock(m)            pthread_mutex_unlock(m)
 
 /* thread specific data */
+#if defined(__sgi) || defined(USE_TSD_DATA_HACK)
+
+/* Hack for thread-specific data, e.g. on Irix 6.x.  We can't use
+   pthread_setspecific because that function calls malloc() itself.
+   The hack only works when pthread_t can be converted to an integral
+   type. */
+
+typedef void *tsd_key_t[256];
+#define tsd_key_create(key, destr) do { \
+  int i; \
+  for(i=0; i<256; i++) (*key)[i] = 0; \
+} while(0)
+#define tsd_setspecific(key, data) \
+ (key[(unsigned)pthread_self() % 256] = (data))
+#define tsd_getspecific(key, vptr) \
+ (vptr = key[(unsigned)pthread_self() % 256])
+
+#else
+
 typedef pthread_key_t tsd_key_t;
 
 #define tsd_key_create(key, destr) pthread_key_create(key, destr)
 #define tsd_setspecific(key, data) pthread_setspecific(key, data)
 #define tsd_getspecific(key, vptr) (vptr = pthread_getspecific(key))
 
+#endif
+
 /* at fork */
 #define thread_atfork(prepare, parent, child) \
                                    pthread_atfork(prepare, parent, child)
diff --git a/manual/arith.texi b/manual/arith.texi
index 431b4dbfec..31d638c2a2 100644
--- a/manual/arith.texi
+++ b/manual/arith.texi
@@ -422,11 +422,11 @@ sqrt (creal (@var{z}) * creal (@var{z}) + cimag (@var{z}) * cimag (@var{z}))
 @end smallexample
 
 This function should always be used instead of the direct formula since
-using the simple straight-forward method can mean to loose accuracy.  If
+using the simple straight-forward method can mean to lose accuracy.  If
 one of the squared values is neglectable in size compared to the other
 value the result should be the same as the larger value.  But squaring
 the value and afterwards using the square root function leads to
-unaccuracy.  See @code{hypot} in @xref{Exponents and Logarithms}.
+inaccuracy.  See @code{hypot} in @xref{Exponents and Logarithms}.
 @end deftypefun
 
 @node Normalization Functions
diff --git a/manual/filesys.texi b/manual/filesys.texi
index 6d62545cc4..4cf4f99c07 100644
--- a/manual/filesys.texi
+++ b/manual/filesys.texi
@@ -461,8 +461,9 @@ are of type @code{struct dirent **}.  I.e., one cannot directly use the
 @code{alphasort} and @code{versionsort} below.
 
 The return value of the function gives the number of entries placed in
-@var{namelist}.  If it is @code{-1} an error occurred and the global
-variable @code{errno} contains more information on the error.
+@var{namelist}.  If it is @code{-1} an error occurred (either the
+directory could not be opened for reading or the malloc call failed) and
+the global variable @code{errno} contains more information on the error.
 @end deftypefun
 
 As said above the fourth argument to the @code{scandir} function must be
diff --git a/manual/job.texi b/manual/job.texi
index f97aceb61c..342aee326b 100644
--- a/manual/job.texi
+++ b/manual/job.texi
@@ -1247,3 +1247,21 @@ The @var{pgid} isn't a process group in the same session as the calling
 process.
 @end table
 @end deftypefun
+
+@comment termios.h
+@comment Unix98
+@deftypefun pid_t tcgetsid (int @var{fildes})
+This function is used to obtain the process group ID of the session
+for which terminal specified by @var{fildes} is the controlling terminal.
+If the call is successful the group ID is returned.  Otherwise the
+return value is @code{(pid_t) -1} and the global variable @var{errno}
+is set to the following value:
+@table @code
+@item EBADF
+The @var{filedes} argument is not a valid file descriptor.
+
+@item ENOTTY
+The calling process does not have a controlling terminal, or the file
+ins not the controlling terminal.
+@end table
+@end deftypefun
diff --git a/manual/pattern.texi b/manual/pattern.texi
index 7a37e402c1..596b72d4fa 100644
--- a/manual/pattern.texi
+++ b/manual/pattern.texi
@@ -468,6 +468,21 @@ glob ("~homer/bin/*", GLOB_TILDE, NULL, &result)
 This functionality is equivalent to what is available in C-shells.
 @end table
 
+Calling @code{glob} will in most cases allocate resources which are used
+to represent the result of the function call.  If the same object of
+type @code{glob_t} is used in multiple call to @code{glob} the resources
+are freed or reused so that no leaks appear.  But this does not include
+the time when all @code{glob} calls are done.
+
+@comment glob.h
+@comment POSIX.2
+@deftypefun void globfree (glob_t *@var{pglob})
+The @code{globfree} function frees all resources allocated by previous
+calls to @code{glob} associated with the object pointed to by
+@var{pglob}.  This function should be called whenever the currently used
+@code{glob_t} typed object isn't used anymore.
+@end deftypefun
+
 
 @node Regular Expressions
 @section Regular Expression Matching
diff --git a/manual/string.texi b/manual/string.texi
index 767a811c7e..3d60fa4d2e 100644
--- a/manual/string.texi
+++ b/manual/string.texi
@@ -505,15 +505,15 @@ hello, wo
 
 @comment string.h
 @comment BSD
-@deftypefun {void *} bcopy (void *@var{from}, const void *@var{to}, size_t @var{size})
+@deftypefun void bcopy (const void *@var{from}, void *@var{to}, size_t @var{size})
 This is a partially obsolete alternative for @code{memmove}, derived from
 BSD.  Note that it is not quite equivalent to @code{memmove}, because the
-arguments are not in the same order.
+arguments are not in the same order and there is no return value.
 @end deftypefun
 
 @comment string.h
 @comment BSD
-@deftypefun {void *} bzero (void *@var{block}, size_t @var{size})
+@deftypefun void bzero (void *@var{block}, size_t @var{size})
 This is a partially obsolete alternative for @code{memset}, derived from
 BSD.  Note that it is not as general as @code{memset}, because the only
 value it can store is zero.
diff --git a/manual/terminal.texi b/manual/terminal.texi
index 7e0f985220..ea62e26447 100644
--- a/manual/terminal.texi
+++ b/manual/terminal.texi
@@ -1096,10 +1096,23 @@ the only speeds that typical serial lines can support.
 @comment termios.h
 @comment POSIX.1
 @vindex B38400
+@comment termios.h
+@comment GNU
+@vindex B57600
+@comment termios.h
+@comment GNU
+@vindex B115200
+@comment termios.h
+@comment GNU
+@vindex B230400
+@comment termios.h
+@comment GNU
+@vindex B460800
 @smallexample
 B0  B50  B75  B110  B134  B150  B200
 B300  B600  B1200  B1800  B2400  B4800
-B9600  B19200  B38400
+B9600  B19200  B38400 B57600 B115200
+B230400 B460800
 @end smallexample
 
 @vindex EXTA
diff --git a/math/Makefile b/math/Makefile
index d7525d084d..174170d99d 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -80,7 +80,7 @@ tests = test-float test-double $(test-longdouble-$(long-double-fcts)) \
 	test-ifloat test-idouble test-matherr test-fenv \
 	atest-exp atest-sincos atest-exp2 # test-reduce
 # We do the `long double' tests only if this data type is available and
-# distrinct from `double'.
+# distinct from `double'.
 test-longdouble-yes = test-ldouble test-ildoubl
 
 CFLAGS-test-float.c = -fno-inline -ffloat-store
diff --git a/math/bits/mathcalls.h b/math/bits/mathcalls.h
index dacc264136..3073f25be4 100644
--- a/math/bits/mathcalls.h
+++ b/math/bits/mathcalls.h
@@ -38,7 +38,10 @@
 
    This is just like __MATHCALL but for a function returning `TYPE'
    instead of `_Mdouble_'.  In all of these cases, there is still
-   both a `NAME' and a `NAMEf' that takes `float' arguments.  */
+   both a `NAME' and a `NAMEf' that takes `float' arguments.
+   
+   Note that there must be no whitespace before the argument passed for
+   NAME, to make token pasting work with -traditional.  */
 
 #ifndef _MATH_H
  #error "Never include <bits/mathcalls.h> directly; include <math.h> instead."
@@ -65,7 +68,7 @@ __MATHCALL (tan,, (_Mdouble_ __x));
 
 #ifdef __USE_GNU
 /* Cosine and sine of X.  */
-__MATHDECL (void, sincos,,
+__MATHDECL (void,sincos,,
 	    (_Mdouble_ __x, _Mdouble_ *__sinx, _Mdouble_ *__cosx));
 #endif
 
@@ -275,13 +278,13 @@ __MATHCALL (remquo,, (_Mdouble_ __x, _Mdouble_ __y, int *__quo));
 
 /* Round X to nearest integral value according to current rounding
    direction.  */
-__MATHDECL (long int, lrint,, (_Mdouble_ __x));
-__MATHDECL (long long int, llrint,, (_Mdouble_ __x));
+__MATHDECL (long int,lrint,, (_Mdouble_ __x));
+__MATHDECL (long long int,llrint,, (_Mdouble_ __x));
 
 /* Round X to nearest integral value, rounding halfway cases away from
    zero.  */
-__MATHDECL (long int, lround,, (_Mdouble_ __x));
-__MATHDECL (long long int, llround,, (_Mdouble_ __x));
+__MATHDECL (long int,lround,, (_Mdouble_ __x));
+__MATHDECL (long long int,llround,, (_Mdouble_ __x));
 
 
 /* Return positive difference between X and Y.  */
diff --git a/misc/syslog.c b/misc/syslog.c
index 7aa29dad7d..0984845699 100644
--- a/misc/syslog.c
+++ b/misc/syslog.c
@@ -210,7 +210,7 @@ vsyslog(pri, fmt, ap)
 	     * is the one from the syslogd failure.
 	     */
 	    if (LogStat & LOG_CONS &&
-		(fd = open(_PATH_CONSOLE, O_WRONLY, 0)) >= 0)
+		(fd = open(_PATH_CONSOLE, O_WRONLY|O_NOCTTY, 0)) >= 0)
 	      {
 		dprintf (fd, "%s\r\n", buf + msgoff);
 		(void)close(fd);
diff --git a/nis/libnsl.map b/nis/libnsl.map
index 49b3754e6d..98404d22c3 100644
--- a/nis/libnsl.map
+++ b/nis/libnsl.map
@@ -26,7 +26,7 @@ GLIBC_2.0 {
     # This functions are needed by the NIS+ tools and rpc.nisd,
     # they should never be used in a normal user program !
     __nis_default_access; __nis_default_group; __nis_default_owner;
-    __nis_default_ttl;    __nis_free_fdresult; __nis_finddirectory;
+    __nis_default_ttl;    __free_fdresult; __nis_finddirectory;
     __nis_hash;		  readColdStartFile;   writeColdStartFile;
 
     # Many programs expect this, but every user program should
diff --git a/nis/nis_call.c b/nis/nis_call.c
index aaefdd22ba..1495271c28 100644
--- a/nis/nis_call.c
+++ b/nis/nis_call.c
@@ -459,7 +459,7 @@ rec_dirsearch (const_nis_name name, directory_obj *dir, u_long flags,
 	if (fd_res->status != NIS_SUCCESS)
 	  {
 	    nis_free_directory (dir);
-	    xdr_free((xdrproc_t)xdr_fd_result, (caddr_t)fd_res);
+	    __free_fdresult (fd_res);
 	    return NULL;
 	  }
 	obj = calloc(1, sizeof(directory_obj));
@@ -511,7 +511,7 @@ rec_dirsearch (const_nis_name name, directory_obj *dir, u_long flags,
 	if (fd_res->status != NIS_SUCCESS)
 	  {
 	    nis_free_directory (dir);
-	    xdr_free((xdrproc_t)xdr_fd_result, (caddr_t)fd_res);
+	    __free_fdresult (fd_res);
 	    return NULL;
 	  }
 	obj = calloc(1, sizeof(directory_obj));
diff --git a/posix/confstr.c b/posix/confstr.c
index 98bdc65d0b..c8d4d73143 100644
--- a/posix/confstr.c
+++ b/posix/confstr.c
@@ -45,6 +45,14 @@ confstr (name, buf, len)
       break;
 
     case _CS_LFS_CFLAGS:
+      /* Signal that we want the new ABI.  */
+      {
+	static const char file_offset[] = "-D_FILE_OFFSET_SIZE=64";
+	string = file_offset;
+	string_len = sizeof (file_offset);
+      }
+      break;
+
     case _CS_LFS_LINTFLAGS:
     case _CS_LFS_LDFLAGS:
     case _CS_LFS_LIBS:
@@ -52,7 +60,7 @@ confstr (name, buf, len)
     case _CS_LFS64_LINTFLAGS:
     case _CS_LFS64_LDFLAGS:
     case _CS_LFS64_LIBS:
-      /* GNU libc does not require special actions to use LFS.  */
+      /* GNU libc does not require special actions to use LFS functions.  */
       string = "";
       string_len = 1;
       break;
diff --git a/posix/unistd.h b/posix/unistd.h
index e44dcff84f..04fb89bc4b 100644
--- a/posix/unistd.h
+++ b/posix/unistd.h
@@ -101,6 +101,15 @@ __BEGIN_DECLS
    _POSIX_MESSAGE_PASSING	POSIX.4 message queues are supported.
    _POSIX_SEMAPHORES		POSIX.4 counting semaphores are supported.
    _POSIX_SHARED_MEMORY_OBJECTS	POSIX.4 shared memory objects are supported.
+   _POSIX_THREADS		POSIX.1c pthreads are supported.
+   _POSIX_THREAD_ATTR_STACKADDR	Thread stack address attribute option supported.
+   _POSIX_THREAD_ATTR_STACKSIZE	Thread stack size attribute option supported.
+   _POSIX_THREAD_SAFE_FUNCTIONS	Thread-safe functions are supported.
+   _POSIX_THREAD_PRIORITY_SCHEDULING
+				POSIX.1c thread execution scheduling supported.
+   _POSIX_THREAD_PRIO_INHERIT	Thread priority inheritance option supported.
+   _POSIX_THREAD_PRIO_PROTECT	Thread priority protection option supported.
+   _POSIX_THREAD_PROCESS_SHARED	Process-shared synchronization supported.
    _POSIX_PII			Protocol-independent interfaces are supported.
    _POSIX_PII_XTI		XTI protocol-indep. interfaces are supported.
    _POSIX_PII_SOCKET		Socket protocol-indep. interfaces are supported.
@@ -261,6 +270,8 @@ extern ssize_t write __P ((int __fd, __const __ptr_t __buf, size_t __n));
 /* Read NBYTES into BUF from FD at the given position OFFSET without
    changing the file pointer.  Return the number read, -1 for errors
    or 0 for EOF.  */
+extern ssize_t __pread __P ((int __fd, __ptr_t __buf, size_t __nbytes,
+			     __off_t __offset));
 # ifndef __USE_FILE_OFFSET64
 extern ssize_t pread __P ((int __fd, __ptr_t __buf, size_t __nbytes,
 			   __off_t __offset));
@@ -268,6 +279,8 @@ extern ssize_t pread __P ((int __fd, __ptr_t __buf, size_t __nbytes,
 extern ssize_t pread __P ((int __fd, __ptr_t __buf, size_t __nbytes,
 			   __off_t __offset)) __asm__ ("pread64");
 # endif
+extern ssize_t __pread64 __P ((int __fd, __ptr_t __buf, size_t __nbytes,
+			       __off64_t __offset));
 # ifdef __USE_LARGEFILE64
 extern ssize_t pread64 __P ((int __fd, __ptr_t __buf, size_t __nbytes,
 			     __off64_t __offset));
@@ -275,6 +288,8 @@ extern ssize_t pread64 __P ((int __fd, __ptr_t __buf, size_t __nbytes,
 
 /* Write N bytes of BUF to FD at the given position OFFSET without
    changing the file pointer.  Return the number written, or -1.  */
+extern ssize_t __pwrite __P ((int __fd, __const __ptr_t __buf, size_t __n,
+			      __off_t __offset));
 # ifndef __USE_FILE_OFFSET64
 extern ssize_t pwrite __P ((int __fd, __const __ptr_t __buf, size_t __n,
 			    __off_t __offset));
@@ -282,6 +297,8 @@ extern ssize_t pwrite __P ((int __fd, __const __ptr_t __buf, size_t __n,
 extern ssize_t pwrite __P ((int __fd, __const __ptr_t __buf, size_t __n,
 			    __off_t __offset)) __asm__ ("pwrite64");
 # endif
+extern ssize_t __pwrite64 __P ((int __fd, __const __ptr_t __buf, size_t __n,
+				__off64_t __offset));
 # ifdef __USE_LARGEFILE64
 extern ssize_t pwrite64 __P ((int __fd, __const __ptr_t __buf, size_t __n,
 			      __off64_t __offset));
diff --git a/posix/wordexp.c b/posix/wordexp.c
index 651c67d552..54a550bf91 100644
--- a/posix/wordexp.c
+++ b/posix/wordexp.c
@@ -36,7 +36,10 @@
 #include <errno.h>
 #include <sys/param.h>
 #include <stdio.h>
+#include <fnmatch.h>
 
+/* Undefine the following line for the production version.  */
+/* #define NDEBUG 1 */
 #include <assert.h>
 
 /*
@@ -874,6 +877,14 @@ parse_param (char **word, size_t *word_length, size_t *max_length,
 	     const char *words, size_t *offset, int flags, wordexp_t *pwordexp)
 {
   /* We are poised just after "$" */
+  enum remove_pattern_enum
+  {
+    RP_NONE = 0,
+    RP_SHORT_LEFT,
+    RP_LONG_LEFT,
+    RP_SHORT_RIGHT,
+    RP_LONG_RIGHT
+  };
   size_t start = *offset;
   size_t env_length = 0;
   size_t env_maxlen = 0;
@@ -882,9 +893,8 @@ parse_param (char **word, size_t *word_length, size_t *max_length,
   char *env = NULL;
   char *pattern = NULL;
   char *value;
-  char action = 0;
-  int prefix = 0;
-  int suffix = 0;
+  char action = '\0';
+  enum remove_pattern_enum remove = RP_NONE;
   int colon_seen = 0;
   int depth = 0;
   int error;
@@ -894,9 +904,10 @@ parse_param (char **word, size_t *word_length, size_t *max_length,
       switch (words[*offset])
 	{
 	case '{':
-	  if (action || prefix || suffix)
+	  ++depth;
+
+	  if (action != '\0' || remove != RP_NONE)
 	    {
-	      ++depth;
 	      pattern = w_addchar (pattern, &pat_length, &pat_maxlen,
 				   words[*offset]);
 	      if (pattern == NULL)
@@ -907,6 +918,7 @@ parse_param (char **word, size_t *word_length, size_t *max_length,
 
 	  if (*offset == start)
 	    break;
+
 	  /* Otherwise evaluate */
 	  /* (and re-parse this character) */
 	  --(*offset);
@@ -914,11 +926,9 @@ parse_param (char **word, size_t *word_length, size_t *max_length,
 
 	case '}':
 	  if (words[start] != '{')
-	    {
 	      --(*offset);
-	    }
 
-	  if (action || prefix || suffix)
+	  if (action != '\0' || remove != RP_NONE)
 	    {
 	      if (--depth)
 		{
@@ -935,53 +945,69 @@ parse_param (char **word, size_t *word_length, size_t *max_length,
 	  goto envsubst;
 
 	case '#':
-	case '%':
-	  if (words[start] == '{')
-	    {
-	      /* At the start?  (ie. 'string length') */
-	      if (*offset == start + 1)
-		break;
+	  /* At the start?  (ie. 'string length') */
+	  if (*offset == start + 1)
+	    /* FIXME: This isn't written yet! */
+	    break;
 
-	      /* Separating variable name from prefix pattern? */
-	      if (words[*offset] == '#')
-		{
-		  if (prefix < 2 && !suffix)
-		    {
-		      ++prefix;
-		      break;
-		    }
-		}
-	      else
-		{
-		  if (suffix < 2 && !prefix)
-		    {
-		      ++suffix;
-		      break;
-		    }
-		}
+	  if (words[start] != '{')
+	    {
+	      /* Evaluate */
+	      /* (and re-parse this character) */
+	      --(*offset);
+	      goto envsubst;
+	    }
 
-	      /* Must be part of prefix/suffix pattern. */
-	      pattern = w_addchar (pattern, &pat_length, &pat_maxlen,
-				   words[*offset]);
-	      if (pattern == NULL)
-		goto no_space;
+	  /* Separating variable name from prefix pattern? */
 
+	  if (remove == RP_NONE)
+	    {
+	      remove = RP_SHORT_LEFT;
+	      break;
+	    }
+	  else if (remove == RP_SHORT_LEFT)
+	    {
+	      remove = RP_LONG_LEFT;
 	      break;
 	    }
-	  /* Otherwise evaluate */
-	  /* (and re-parse this character) */
-	  --(*offset);
-	  goto envsubst;
 
-	case ':':
+	  /* Must be part of prefix/suffix pattern. */
+	  pattern = w_addchar (pattern, &pat_length, &pat_maxlen,
+			       words[*offset]);
+	  if (pattern == NULL)
+	    goto no_space;
+
+	  break;
+
+	case '%':
 	  if (!*env)
+	    goto syntax;
+
+	  /* Separating variable name from suffix pattern? */
+	  if (remove == RP_NONE)
 	    {
-	      free (env);
-	      free (pattern);
-	      return WRDE_SYNTAX;
+	      remove = RP_SHORT_RIGHT;
+	      break;
 	    }
+	  else if (remove == RP_SHORT_RIGHT)
+	    {
+	      remove = RP_LONG_RIGHT;
+	      break;
+	    }
+
+	  /* Must be part of prefix/suffix pattern. */
+	  pattern = w_addchar (pattern, &pat_length, &pat_maxlen,
+			       words[*offset]);
+	  if (pattern == NULL)
+	    goto no_space;
 
-	  if (action || prefix || suffix)
+	  break;
+
+	case ':':
+	  if (!*env)
+	    goto syntax;
+
+	  if (action != '\0' || remove != RP_NONE)
 	    {
 	      pattern = w_addchar (pattern, &pat_length, &pat_maxlen,
 				   words[*offset]);
@@ -998,30 +1024,21 @@ parse_param (char **word, size_t *word_length, size_t *max_length,
 	      break;
 	    }
 
-	  free (env);
-	  free (pattern);
-	  return WRDE_SYNTAX;
+	  goto syntax;
 
 	case '-':
 	case '=':
 	case '?':
 	case '+':
 	  if (!*env)
-	    {
-	      free (env);
-	      free (pattern);
-	      return WRDE_SYNTAX;
-	    }
+	    goto syntax;
 
-	  if (action || prefix || suffix)
+	  if (action != '\0' || remove != RP_NONE)
 	    {
 	      pattern = w_addchar (pattern, &pat_length, &pat_maxlen,
 				   words[*offset]);
 	      if (pattern == NULL)
-		{
-		  free (env);
-		  return WRDE_NOSPACE;
-		}
+		goto no_space;
 
 	      break;
 	    }
@@ -1030,8 +1047,9 @@ parse_param (char **word, size_t *word_length, size_t *max_length,
 	  break;
 
 	case '\\':
-	  if (action || prefix || suffix)
+	  if (action != '\0' || remove != RP_NONE)
 	    {
+	      /* Um. Is this right? */
 	      error = parse_qtd_backslash (word, word_length, max_length,
 					   words, offset);
 	      if (error == 0)
@@ -1042,12 +1060,16 @@ parse_param (char **word, size_t *word_length, size_t *max_length,
 	      error = WRDE_SYNTAX;
 	    }
 
-	  free (env);
-	  free (pattern);
+	  if (env)
+	    free (env);
+
+	  if (pattern != NULL)
+	    free (pattern);
+
 	  return error;
 
 	default:
-	  if (action || prefix || suffix)
+	  if (action != '\0' || remove != RP_NONE)
 	    {
 	      pattern = w_addchar (pattern, &pat_length, &pat_maxlen,
 				   words[*offset]);
@@ -1076,11 +1098,7 @@ parse_param (char **word, size_t *word_length, size_t *max_length,
 
 envsubst:
   if (words[start] == '{' && words[*offset] != '}')
-    {
-      free (env);
-      free (pattern);
-      return WRDE_SYNTAX;
-    }
+    goto syntax;
 
   if (!env || !*env)
     {
@@ -1093,14 +1111,88 @@ envsubst:
 
   value = getenv (env);
 
-  if (action || prefix || suffix)
+  if (action != '\0' || remove != RP_NONE)
     {
       switch (action)
 	{
 	case 0:
-	  /* For the time being, pattern is ignored */
-	  printf ("Pattern: %s\nPrefix: %d\nSuffix: %d\n", pattern, prefix, suffix);
-	  break;
+	  {
+	    char *p;
+	    char c;
+	    char *end;
+
+	    if (!pattern || !*pattern)
+	      break;
+
+	    end = value + strlen (value);
+
+	    if (value == NULL)
+	      break;
+
+	    switch (remove)
+	      {
+	      case RP_SHORT_LEFT:
+		for (p = value; p <= end; p++)
+		  {
+		    c = *p;
+		    *p = '\0';
+		    if (fnmatch (pattern, value, 0) != FNM_NOMATCH)
+		      {
+			*p = c;
+			value = p;
+			break;
+		      }
+		    *p = c;
+		  }
+
+		break;
+
+	      case RP_LONG_LEFT:
+		for (p = end; p >= value; p--)
+		  {
+		    c = *p;
+		    *p = '\0';
+		    if (fnmatch (pattern, value, 0) != FNM_NOMATCH)
+		      {
+			*p = c;
+			value = p;
+			break;
+		      }
+		    *p = c;
+		  }
+
+		break;
+
+	      case RP_SHORT_RIGHT:
+		for (p = end; p >= value; p--)
+		  {
+		    if (fnmatch (pattern, p, 0) != FNM_NOMATCH)
+		      {
+			*p = '\0';
+			break;
+		      }
+		  }
+
+		break;
+
+	      case RP_LONG_RIGHT:
+		for (p = value; p <= end; p++)
+		  {
+		    if (fnmatch (pattern, p, 0) != FNM_NOMATCH)
+		      {
+			*p = '\0';
+			break;
+		      }
+		  }
+
+		break;
+
+	      default:
+		assert (! "Unexpected `remove' value\n");
+	      }
+
+	    break;
+	  }
 
 	case '?':
 	  if (value && *value)
@@ -1182,6 +1274,15 @@ no_space:
     free (pattern);
 
   return WRDE_NOSPACE;
+
+syntax:
+  if (env)
+    free (env);
+
+  if (pattern)
+    free (pattern);
+
+  return WRDE_SYNTAX;
 }
 
 static int
diff --git a/rpm/template b/rpm/template
index 319f62c92f..bc7972bf76 100644
--- a/rpm/template
+++ b/rpm/template
@@ -1,26 +1,41 @@
 Name: glibc
-Description: GNU libc
+Summary: GNU libc
 Group: Development/Libraries/Libc
 Version: @VERSION@
 Release: 1
 Copyright: LGPL, GPL
 Source: glibc-@VERSION@.tar.gz
+BuildRoot: /tmp/libc
+
+%description
+The C language provides no built-in facilities for performing such
+common operations as input/output, memory management, string
+manipulation, and the like.  Instead, these facilities are defined in
+a standard library, which you compile and link with your programs. The
+GNU C library (this package) defines all of the library functions that
+are specified by the ISO C standard, as well as additional features
+specific to POSIX and other derivatives of the Unix operating system,
+and extensions specific to the GNU system.
 
 %prep
 %setup
 
+rm -rf $RPM_BUILD_ROOT
+mkdir $RPM_BUILD_ROOT
+
 %build
 configure --prefix=@prefix@
-if test x@prefix@ = x/usr; then
-  cat >configparms <<EOF
-slibdir=/lib
-sysconfdir=/etc
+cat >configparms <<EOF
+CFLAGS=$RPM_OPT_FLAGS
+install_root=$RPM_BUILD_ROOT
 EOF
-fi
 make
 
+%clean
+rm -rf $RPM_BUILD_ROOT
+
 %install
 make install
 
 %files
-%doc FAQ NEWS NOTES README INSTALL
+%doc BUGS FAQ NEWS NOTES README INSTALL
diff --git a/stdio-common/Makefile b/stdio-common/Makefile
index 362c77c24f..409e64a91c 100644
--- a/stdio-common/Makefile
+++ b/stdio-common/Makefile
@@ -25,7 +25,8 @@ headers	:= bits/stdio_lim.h printf.h
 
 routines	:=							      \
 	ctermid cuserid							      \
-	vfprintf vprintf printf_fp reg-printf printf-prs _itoa printf_fphex   \
+	_itoa itoa-digits						      \
+	vfprintf vprintf printf_fp reg-printf printf-prs printf_fphex	      \
 	printf_size fprintf printf snprintf sprintf asprintf dprintf	      \
 	vfscanf 							      \
 	fscanf scanf sscanf						      \
diff --git a/stdio-common/_itoa.c b/stdio-common/_itoa.c
index 91bc8a83d0..e5705d54b2 100644
--- a/stdio-common/_itoa.c
+++ b/stdio-common/_itoa.c
@@ -157,11 +157,9 @@ static const struct base_table_t base_table[] =
 };
 
 /* Lower-case digits.  */
-const char _itoa_lower_digits[]
-	= "0123456789abcdefghijklmnopqrstuvwxyz";
+extern const char _itoa_lower_digits[];
 /* Upper-case digits.  */
-const char _itoa_upper_digits[]
-	= "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+extern const char _itoa_upper_digits[];
 
 
 char *
diff --git a/stdio-common/itoa-digits.c b/stdio-common/itoa-digits.c
new file mode 100644
index 0000000000..b475bbca42
--- /dev/null
+++ b/stdio-common/itoa-digits.c
@@ -0,0 +1,26 @@
+/* Digits.
+   Copyright (C) 1994, 1995, 1996 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.  */
+
+/* Lower-case digits.  */
+const char _itoa_lower_digits[]
+	= "0123456789abcdefghijklmnopqrstuvwxyz";
+/* Upper-case digits.  */
+const char _itoa_upper_digits[]
+	= "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+
diff --git a/stdlib/mblen.c b/stdlib/mblen.c
index 120551c9a2..e43b076371 100644
--- a/stdlib/mblen.c
+++ b/stdlib/mblen.c
@@ -17,14 +17,37 @@
    Boston, MA 02111-1307, USA.  */
 
 #include <stdlib.h>
-
-#undef	mblen
+#include <wchar.h>
 
 
 /* Return the length of the multibyte character (if there is one)
-   at S which is no longer than N characters.  */
+   at S which is no longer than N characters.
+   The ISO C standard says that the `mblen' function must not change
+   the global state.  */
 int
 mblen (const char *s, size_t n)
 {
-  return mbtowc ((wchar_t *) NULL, s, n);
+  mbstate_t state;
+  int result;
+
+  /* If S is NULL the function has to return null or not null
+     depending on the encoding having a state depending encoding or
+     not.  This is nonsense because any multibyte encoding has a
+     state.  The ISO C amendment 1 corrects this while introducing the
+     restartable functions.  We simply say here all encodings have a
+     state.  */
+  if (s == NULL)
+    return 1;
+
+  state.count = 0;
+  state.value = 0;
+
+  result = __mbrtowc (NULL, s, n, &state);
+
+  /* The `mbrtowc' functions tell us more than we need.  Fold the -1
+     and -2 result into -1.  */
+  if (result < 0)
+    result = -1;
+
+  return result;
 }
diff --git a/stdlib/stdlib.h b/stdlib/stdlib.h
index 2adefb508f..4bf3105269 100644
--- a/stdlib/stdlib.h
+++ b/stdlib/stdlib.h
@@ -686,14 +686,6 @@ extern int mbtowc __P ((wchar_t *__restrict __pwc,
    by WCHAR in S, returning its length.  */
 extern int wctomb __P ((char *__s, wchar_t __wchar));
 
-#if defined __OPTIMIZE__ && __GNUC__ >= 2
-extern __inline int
-mblen (__const char *__s, size_t __n)
-{
-  return mbtowc ((wchar_t *) NULL, __s, __n);
-}
-#endif /* Optimizing GCC >=2.  */
-
 
 /* Convert a multibyte string to a wide char string.  */
 extern size_t mbstowcs __P ((wchar_t *__restrict  __pwcs,
diff --git a/string/bits/string2.h b/string/bits/string2.h
index c2e63b6ebc..e0bded08e3 100644
--- a/string/bits/string2.h
+++ b/string/bits/string2.h
@@ -52,16 +52,22 @@
 
 # if __BYTE_ORDER == __LITTLE_ENDIAN
 #  define __STRING2_SMALL_GET16(src, idx) \
-     (((src)[idx + 1] << 8) | (src)[idx])
+     (((__const unsigned char *) (src))[idx + 1] << 8			      \
+      | ((__const unsigned char *) (src))[idx])
 #  define __STRING2_SMALL_GET32(src, idx) \
-     ((((src)[idx + 3] << 8 | (src)[idx + 2]) << 8			      \
-       | (src)[idx + 1]) << 8 | (src)[idx])
+     (((((__const unsigned char *) (src))[idx + 3] << 8			      \
+	| ((__const char *) (src))[idx + 2]) << 8			      \
+       | ((__const unsigned char *) (src))[idx + 1]) << 8		      \
+      | ((__const unsigned char *) (src))[idx])
 # else
 #  define __STRING2_SMALL_GET16(src, idx) \
-     (((src)[idx] << 8) | (src)[idx + 1])
+     (((__const unsigned char *) (src))[idx] << 8			      \
+      | ((__const unsigned char *) (src))[idx + 1])
 #  define __STRING2_SMALL_GET32(src, idx) \
-     ((((src)[idx] << 8 | (src)[idx + 1]) << 8				      \
-       | (src)[idx + 2]) << 8 | (src)[idx + 3])
+     (((((__const unsigned char *) (src))[idx] << 8			      \
+	| ((__const unsigned char *) (src))[idx + 1]) << 8		      \
+       | ((__const unsigned char *) (src))[idx + 2]) << 8		      \
+      | ((__const unsigned char *) (src))[idx + 3])
 # endif
 #else
 /* These are a few types we need for the optimizations if we cannot
@@ -159,43 +165,66 @@ __STRING2_COPY_TYPE (8);
 			break;						      \
 		      case 2:						      \
 			*((__STRING2_COPY_ARR2 *) __dest) =		      \
-			  ((__STRING2_COPY_ARR2) { { (src)[0], '\0' } });     \
+			  ((__STRING2_COPY_ARR2)			      \
+			   { { ((__const unsigned char *) (src))[0],	      \
+			       '\0' } });				      \
 			break;						      \
 		      case 3:						      \
 			*((__STRING2_COPY_ARR3 *) __dest) =		      \
-			  ((__STRING2_COPY_ARR3) { { (src)[0], (src)[1],      \
-						     '\0' } });		      \
+			  ((__STRING2_COPY_ARR3)			      \
+			   { { ((__const unsigned char *) (src))[0],	      \
+			       ((__const unsigned char *) (src))[1],	      \
+			       '\0' } });				      \
 			break;						      \
 		      case 4:						      \
 			*((__STRING2_COPY_ARR4 *) __dest) =		      \
-			  ((__STRING2_COPY_ARR4) { { (src)[0], (src)[1],      \
-						     (src)[2], '\0' } });     \
+			  ((__STRING2_COPY_ARR4)			      \
+			   { { ((__const unsigned char *) (src))[0],	      \
+			       ((__const unsigned char *) (src))[1],	      \
+			       ((__const unsigned char *) (src))[2],	      \
+			       '\0' } });				      \
 			break;						      \
 		      case 5:						      \
 			*((__STRING2_COPY_ARR5 *) __dest) =		      \
-			  ((__STRING2_COPY_ARR5) { { (src)[0], (src)[1],      \
-						     (src)[2], (src)[3],      \
-						     '\0' } });		      \
+			  ((__STRING2_COPY_ARR5)			      \
+			   { { ((__const unsigned char *) (src))[0],	      \
+			       ((__const unsigned char *) (src))[1],	      \
+			       ((__const unsigned char *) (src))[2],	      \
+			       ((__const unsigned char *) (src))[3],	      \
+			       '\0' } });				      \
 			break;						      \
 		      case 6:						      \
 			*((__STRING2_COPY_ARR6 *) __dest) =		      \
-			  ((__STRING2_COPY_ARR6) { { (src)[0], (src)[1],      \
-						     (src)[2], (src)[3],      \
-						     (src)[4], '\0' } });     \
+			  ((__STRING2_COPY_ARR6)			      \
+			   { { ((__const unsigned char *) (src))[0],	      \
+			       ((__const unsigned char *) (src))[1],	      \
+			       ((__const unsigned char *) (src))[2],	      \
+			       ((__const unsigned char *) (src))[3],	      \
+			       ((__const unsigned char *) (src))[4],	      \
+			       '\0' } });				      \
 			break;						      \
 		      case 7:						      \
 			*((__STRING2_COPY_ARR7 *) __dest) =		      \
-			  ((__STRING2_COPY_ARR7) { { (src)[0], (src)[1],      \
-						     (src)[2], (src)[3],      \
-						     (src)[4], (src)[5],      \
-						     '\0' } });		      \
+			  ((__STRING2_COPY_ARR7)			      \
+			   { { ((__const unsigned char *) (src))[0],	      \
+			       ((__const unsigned char *) (src))[1],	      \
+			       ((__const unsigned char *) (src))[2],	      \
+			       ((__const unsigned char *) (src))[3],	      \
+			       ((__const unsigned char *) (src))[4],	      \
+			       ((__const unsigned char *) (src))[5],	      \
+			       '\0' } });				      \
 			break;						      \
 		      case 8:						      \
 			*((__STRING2_COPY_ARR8 *) __dest) =		      \
-			  ((__STRING2_COPY_ARR8) { { (src)[0], (src)[1],      \
-						     (src)[2], (src)[3],      \
-						     (src)[4], (src)[5],      \
-						     (src)[6], '\0' } });     \
+			  ((__STRING2_COPY_ARR8)			      \
+			   { { ((__const unsigned char *) (src))[0],	      \
+			       ((__const unsigned char *) (src))[1],	      \
+			       ((__const unsigned char *) (src))[2],	      \
+			       ((__const unsigned char *) (src))[3],	      \
+			       ((__const unsigned char *) (src))[4],	      \
+			       ((__const unsigned char *) (src))[5],	      \
+			       ((__const unsigned char *) (src))[6],	      \
+			       '\0' } });				      \
 			break;						      \
 		    }							      \
 		  (char *) __dest; }))
@@ -280,43 +309,66 @@ __STRING2_COPY_TYPE (8);
 			break;						      \
 		      case 2:						      \
 			*((__STRING2_COPY_ARR2 *) __dest) =		      \
-			  ((__STRING2_COPY_ARR2) { { (src)[0], '\0' } });     \
+			  ((__STRING2_COPY_ARR2)			      \
+			   { { ((__const unsigned char *) (src))[0],	      \
+			       '\0' } });				      \
 			break;						      \
 		      case 3:						      \
 			*((__STRING2_COPY_ARR3 *) __dest) =		      \
-			  ((__STRING2_COPY_ARR3) { { (src)[0], (src)[1],      \
-						     '\0' } });		      \
+			  ((__STRING2_COPY_ARR3)			      \
+			   { { ((__const unsigned char *) (src))[0],	      \
+			       ((__const unsigned char *) (src))[1],	      \
+			       '\0' } });				      \
 			break;						      \
 		      case 4:						      \
 			*((__STRING2_COPY_ARR4 *) __dest) =		      \
-			  ((__STRING2_COPY_ARR4) { { (src)[0], (src)[1],      \
-						     (src)[2], '\0' } });     \
+			  ((__STRING2_COPY_ARR4)			      \
+			   { { ((__const unsigned char *) (src))[0],	      \
+			       ((__const unsigned char *) (src))[1],	      \
+			       ((__const unsigned char *) (src))[2],	      \
+			       '\0' } });				      \
 			break;						      \
 		      case 5:						      \
 			*((__STRING2_COPY_ARR5 *) __dest) =		      \
-			  ((__STRING2_COPY_ARR5) { { (src)[0], (src)[1],      \
-						     (src)[2], (src)[3],      \
-						     '\0' } });		      \
+			  ((__STRING2_COPY_ARR5)			      \
+			   { { ((__const unsigned char *) (src))[0],	      \
+			       ((__const unsigned char *) (src))[1],	      \
+			       ((__const unsigned char *) (src))[2],	      \
+			       ((__const unsigned char *) (src))[3],	      \
+			       '\0' } });				      \
 			break;						      \
 		      case 6:						      \
 			*((__STRING2_COPY_ARR6 *) __dest) =		      \
-			  ((__STRING2_COPY_ARR6) { { (src)[0], (src)[1],      \
-						     (src)[2], (src)[3],      \
-						     (src)[4], '\0' } });     \
+			  ((__STRING2_COPY_ARR6)			      \
+			   { { ((__const unsigned char *) (src))[0],	      \
+			       ((__const unsigned char *) (src))[1],	      \
+			       ((__const unsigned char *) (src))[2],	      \
+			       ((__const unsigned char *) (src))[3],	      \
+			       ((__const unsigned char *) (src))[4],	      \
+			       '\0' } });				      \
 			break;						      \
 		      case 7:						      \
 			*((__STRING2_COPY_ARR7 *) __dest) =		      \
-			  ((__STRING2_COPY_ARR7) { { (src)[0], (src)[1],      \
-						     (src)[2], (src)[3],      \
-						     (src)[4], (src)[5],      \
-						     '\0' } });		      \
+			  ((__STRING2_COPY_ARR7)			      \
+			   { { ((__const unsigned char *) (src))[0],	      \
+			       ((__const unsigned char *) (src))[1],	      \
+			       ((__const unsigned char *) (src))[2],	      \
+			       ((__const unsigned char *) (src))[3],	      \
+			       ((__const unsigned char *) (src))[4],	      \
+			       ((__const unsigned char *) (src))[5],	      \
+			       '\0' } });				      \
 			break;						      \
 		      case 8:						      \
 			*((__STRING2_COPY_ARR8 *) __dest) =		      \
-			  ((__STRING2_COPY_ARR8) { { (src)[0], (src)[1],      \
-						     (src)[2], (src)[3],      \
-						     (src)[4], (src)[5],      \
-						     (src)[6], '\0' } });     \
+			  ((__STRING2_COPY_ARR8)			      \
+			   { { ((__const unsigned char *) (src))[0],	      \
+			       ((__const unsigned char *) (src))[1],	      \
+			       ((__const unsigned char *) (src))[2],	      \
+			       ((__const unsigned char *) (src))[3],	      \
+			       ((__const unsigned char *) (src))[4],	      \
+			       ((__const unsigned char *) (src))[5],	      \
+			       ((__const unsigned char *) (src))[6],	      \
+			       '\0' } });				      \
 			break;						      \
 		    }							      \
 		  (char *) (__dest + ((srclen) - 1)); }))
@@ -390,49 +442,63 @@ __STRING2_COPY_TYPE (8);
 			: strcmp (s1, s2)))))
 
 # define __strcmp_cc(s1, s2, l) \
-  (__extension__ ({ register int __result = ((unsigned char) (s1)[0]	      \
-					     - (unsigned char) (s2)[0]);      \
+  (__extension__ ({ register int __result =				      \
+		      (((__const unsigned char *) (s1))[0]		      \
+		       - ((__const unsigned char *) (s2))[0]);		      \
 		    if (l > 0 && __result == 0)				      \
 		      {							      \
-			__result = ((unsigned char) (s1)[1]		      \
-				    - (unsigned char) (s2)[1]);		      \
+			__result = (((__const unsigned char *) (s1))[1]	      \
+				    - ((__const unsigned char *) (s2))[1]);   \
 			if (l > 1 && __result == 0)			      \
 			  {						      \
-			    __result = ((unsigned char) (s1)[2]		      \
-					- (unsigned char) (s2)[2]);	      \
+			    __result =					      \
+			      (((__const unsigned char *) (s1))[2]	      \
+			       - ((__const unsigned char *) (s2))[2]);	      \
 			    if (l > 2 && __result == 0)			      \
-			      __result = ((unsigned char) (s1)[3]	      \
-					  - (unsigned char) (s2)[3]);	      \
+			      __result =				      \
+				(((__const unsigned char *) (s1))[3]	      \
+				 - ((__const unsigned char *) (s2))[3]);      \
 			  }						      \
 		      }							      \
 		    __result; }))
 
 # define __strcmp_cg(s1, s2, l1) \
-  (__extension__ ({ __const unsigned char *__s2 = (unsigned char *) (s2);     \
-		    register int __result = (unsigned char) (s1)[0] - __s2[0];\
+  (__extension__ ({ __const unsigned char *__s2 =			      \
+		      (__const unsigned char *) (s2);			      \
+		    register int __result =				      \
+		      (((__const unsigned char *) (s1))[0] - __s2[0]);	      \
 		    if (l1 > 0 && __result == 0)			      \
 		      {							      \
-			__result = (unsigned char) (s1)[1] - __s2[1];	      \
+			__result = (((__const unsigned char *) (s1))[1]	      \
+				    - __s2[1]);				      \
 			if (l1 > 1 && __result == 0)			      \
 			  {						      \
-			    __result = (unsigned char) (s1)[2] - __s2[2];     \
+			    __result = (((__const unsigned char *) (s1))[2]   \
+					- __s2[2]);			      \
 			    if (l1 > 2 && __result == 0)		      \
-			      __result = (unsigned char) (s1)[3] - __s2[3];   \
+			      __result = (((__const unsigned char *) (s1))[3] \
+					  - __s2[3]);			      \
 			  }						      \
 		      }							      \
 		    __result; }))
 
 # define __strcmp_gc(s1, s2, l2) \
-  (__extension__ ({ __const unsigned char *__s1 = (unsigned char *) (s1);     \
-		    register int __result = __s1[0] - (unsigned char) (s2)[0];\
+  (__extension__ ({ __const unsigned char *__s1 =			      \
+		      (__const unsigned char *) (s1);			      \
+		    register int __result =				      \
+		      __s1[0] - ((__const unsigned char *) (s2))[0];	      \
 		    if (l2 > 0 && __result == 0)			      \
 		      {							      \
-			__result = __s1[1] - (unsigned char) (s2)[1];	      \
+			__result = (__s1[1]				      \
+				    - ((__const unsigned char *) (s2))[1]);   \
 			if (l2 > 1 && __result == 0)			      \
 			  {						      \
-			    __result = __s1[2] - (unsigned char) (s2)[2];     \
+			    __result =					      \
+			      (__s1[2] - ((__const unsigned char *) (s2))[2]);\
 			    if (l2 > 2 && __result == 0)		      \
-			      __result = __s1[3] - (unsigned char) (s2)[3];   \
+			      __result =				      \
+				(__s1[3]				      \
+				 - ((__const unsigned char *)(s2))[3]);	      \
 			  }						      \
 		      }							      \
 		    __result; }))
@@ -455,10 +521,10 @@ __STRING2_COPY_TYPE (8);
 #ifndef _HAVE_STRING_ARCH_strcspn
 # define strcspn(s, reject) \
   (__extension__ (__builtin_constant_p (reject) && __string2_1bptr_p (reject) \
-		  ? ((reject)[0] == '\0'				      \
+		  ? (((__const unsigned char *) (reject))[0] == '\0'	      \
 		     ? strlen (s)					      \
-		     : ((reject)[1] == '\0'				      \
-			? __strcspn_c1 (s, (reject)[0])			      \
+		     : (((__const unsigned char *) (reject))[1] == '\0'	      \
+			? __strcspn_c1 (s, ((__const char *) (reject))[0])    \
 			: strcspn (s, reject)))				      \
 		  : strcspn (s, reject)))
 
@@ -479,10 +545,10 @@ __strcspn_c1 (__const char *__s, char __reject)
 #ifndef _HAVE_STRING_ARCH_strspn
 # define strspn(s, accept) \
   (__extension__ (__builtin_constant_p (accept) && __string2_1bptr_p (accept) \
-		  ? ((accept)[0] == '\0'				      \
+		  ? (((__const unsigned char *) (accept))[0] == '\0'	      \
 		     ? 0						      \
-		     : ((accept)[1] == '\0'				      \
-			? __strspn_c1 (s, (accept)[0])			      \
+		     : (((__const unsigned char *) (accept))[1] == '\0'	      \
+			? __strspn_c1 (s, ((__const char *) (accept))[0])     \
 			: strspn (s, accept)))				      \
 		  : strspn (s, accept)))
 
@@ -503,10 +569,10 @@ __strspn_c1 (__const char *__s, char __accept)
 #ifndef _HAVE_STRING_ARCH_strpbrk
 # define strpbrk(s, accept) \
   (__extension__ (__builtin_constant_p (accept) && __string2_1bptr_p (accept) \
-		  ? ((accept)[0] == '\0'				      \
+		  ? (((__const unsigned char  *) (accept))[0] == '\0'	      \
 		     ? NULL						      \
-		     : ((accept)[1] == '\0'				      \
-			? strchr (s, (accept)[0])			      \
+		     : (((__const unsigned char *) (accept))[1] == '\0'	      \
+			? strchr (s, ((__const unsigned char *) (accept))[0]) \
 			: strpbrk (s, accept)))				      \
 		  : strpbrk (s, accept)))
 #endif
@@ -516,10 +582,11 @@ __strspn_c1 (__const char *__s, char __accept)
 #ifndef _HAVE_STRING_ARCH_strstr
 # define strstr(haystack, needle) \
   (__extension__ (__builtin_constant_p (needle) && __string2_1bptr_p (needle) \
-		  ? ((needle)[0] == '\0'				      \
+		  ? (((__const unsigned char *) (needle))[0] == '\0'	      \
 		     ? haystack						      \
-		     : ((needle)[1] == '\0'				      \
-			? strchr (haystack, (needle)[0])		      \
+		     : (((__const unsigned char *) (needle))[1] == '\0'	      \
+			? strchr (haystack,				      \
+				  ((__const unsigned char *) (needle))[0])    \
 			: strstr (haystack, needle)))			      \
 		  : strstr (haystack, needle)))
 #endif
@@ -543,8 +610,10 @@ strnlen (__const char *__string, size_t __maxlen)
 
 #  define strsep(s, reject) \
   (__extension__ (__builtin_constant_p (reject) && __string2_1bptr_p (reject) \
-		  ? ((reject)[0] != '\0' && (reject)[1] == '\0'		      \
-		     ? __strsep_1c (s, (reject)[0])			      \
+		  ? (((__const unsigned char *) (reject))[0] != '\0'	      \
+		     && ((__const unsigned char *) (reject))[1] == '\0'	      \
+		     ? __strsep_1c (s,					      \
+				    ((__const unsigned char *) (reject))[0])  \
 		     : __strsep_g (s, reject))				      \
 		  : __strsep_g (s, reject)))
 
diff --git a/sunrpc/clnt_perr.c b/sunrpc/clnt_perr.c
index 89f61f0d64..af0fe4313c 100644
--- a/sunrpc/clnt_perr.c
+++ b/sunrpc/clnt_perr.c
@@ -134,6 +134,7 @@ clnt_sperror (CLIENT * rpch, const char *msg)
       break;
     }
   *str = '\n';
+  *++str = '\0';
   return (strstart);
 }
 
@@ -252,6 +253,7 @@ clnt_spcreateerror (const char *msg)
       break;
     }
   *cp = '\n';
+  *++cp = '\0';
   return str;
 }
 
diff --git a/sunrpc/get_myaddr.c b/sunrpc/get_myaddr.c
index 757fe06718..86277d2390 100644
--- a/sunrpc/get_myaddr.c
+++ b/sunrpc/get_myaddr.c
@@ -39,6 +39,7 @@ static char sccsid[] = "@(#)get_myaddress.c 1.4 87/08/11 Copyr 1984 Sun Micro";
  */
 
 #include <rpc/types.h>
+#include <rpc/clnt.h>
 #include <rpc/pmap_prot.h>
 #include <sys/socket.h>
 #include <stdio.h>
diff --git a/sunrpc/pmap_clnt.c b/sunrpc/pmap_clnt.c
index 263cd130b9..68bdfab01e 100644
--- a/sunrpc/pmap_clnt.c
+++ b/sunrpc/pmap_clnt.c
@@ -42,8 +42,6 @@ static char sccsid[] = "@(#)pmap_clnt.c 1.37 87/08/11 Copyr 1984 Sun Micro";
 #include <rpc/pmap_prot.h>
 #include <rpc/pmap_clnt.h>
 
-extern void get_myaddress (struct sockaddr_in *addr);
-
 static const struct timeval timeout = {5, 0};
 static const struct timeval tottimeout = {60, 0};
 
diff --git a/sunrpc/rpc/clnt.h b/sunrpc/rpc/clnt.h
index 0991eea937..38f40909dc 100644
--- a/sunrpc/rpc/clnt.h
+++ b/sunrpc/rpc/clnt.h
@@ -379,9 +379,18 @@ extern struct rpc_createerr rpc_createerr;
  */
 extern char *clnt_sperrno __P ((enum clnt_stat __num));	/* string */
 
+/*
+ * get the port number on the host for the rpc program,version and proto
+ */
 extern int getrpcport __P ((__const char * __host, u_long __prognum,
 			   u_long __versnum, u_int proto));
 
+/*
+ * get the local host's IP address without consulting
+ * name service library functions
+ */
+extern void get_myaddress __P ((struct sockaddr_in *));
+
 #define UDPMSGSIZE	8800	/* rpc imposed limit on udp msg size */
 #define RPCSMALLMSGSIZE	400	/* a more reasonable packet size */
 
diff --git a/sysdeps/generic/_strerror.c b/sysdeps/generic/_strerror.c
index 83156293a5..bcba45d519 100644
--- a/sysdeps/generic/_strerror.c
+++ b/sysdeps/generic/_strerror.c
@@ -45,7 +45,7 @@ _strerror_internal (int errnum, char *buf, size_t buflen)
       const size_t unklen = strlen (unk);
       char *p = buf + buflen;
       *--p = '\0';
-      p = _itoa (errnum, p, 10, 0);
+      p = _itoa_word (errnum, p, 10, 0);
       return memcpy (p - unklen, unk, unklen);
     }
 
diff --git a/sysdeps/generic/des_impl.c b/sysdeps/generic/des_impl.c
index e0a3af9dd9..f801a841fc 100644
--- a/sysdeps/generic/des_impl.c
+++ b/sysdeps/generic/des_impl.c
@@ -18,6 +18,8 @@
 
 /* We must not distribute the DES implementation as part of the glibc.
    So we have to provide a dummy version here.  */
+#include <des.h>
+
 int
 _des_crypt (char *buf, unsigned len, struct desparams *desp)
 {
diff --git a/sysdeps/generic/dl-cache.c b/sysdeps/generic/dl-cache.c
index c704fd869d..36d6c707d3 100644
--- a/sysdeps/generic/dl-cache.c
+++ b/sysdeps/generic/dl-cache.c
@@ -53,10 +53,7 @@ _dl_load_cache_lookup (const char *name)
   static struct cache_file *cache;
   static size_t cachesize;
   unsigned int i;
-
-  if (cache == (void *) -1)
-    /* Previously looked for the cache file and didn't find it.  */
-    return NULL;
+  const char *best;
 
   if (cache == NULL)
     {
@@ -76,6 +73,11 @@ _dl_load_cache_lookup (const char *name)
 	}
     }
 
+  if (cache == (void *) -1)
+    /* Previously looked for the cache file and didn't find it.  */
+    return NULL;
+
+  best = NULL;
   for (i = 0; i < cache->nlibs; ++i)
     if ((cache->libs[i].flags == 1 ||
 	 cache->libs[i].flags == 3) && /* ELF library entry.  */
@@ -85,7 +87,14 @@ _dl_load_cache_lookup (const char *name)
 	/* Does the name match?  */
 	! strcmp (name, ((const char *) &cache->libs[cache->nlibs] +
 			 cache->libs[i].key)))
-      return (const char *) &cache->libs[cache->nlibs] + cache->libs[i].value;
+      {
+	best = ((const char *) &cache->libs[cache->nlibs]
+		+ cache->libs[i].value);
 
-  return NULL;
+	if (cache->libs[i].flags == 3)
+	  /* We've found an exact match for the shared object and no
+	     general `ELF' release.  Stop searching.  */
+	  break;
+      }
+  return best;
 }
diff --git a/sysdeps/generic/memcmp.c b/sysdeps/generic/memcmp.c
index 844cdc6afb..213ccc07de 100644
--- a/sysdeps/generic/memcmp.c
+++ b/sysdeps/generic/memcmp.c
@@ -18,56 +18,64 @@
    Boston, MA 02111-1307, USA.  */
 
 #ifdef HAVE_CONFIG_H
-#include "config.h"
+# include "config.h"
 #endif
 
 #undef	__ptr_t
-#if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
-#define	__ptr_t	void *
+#if defined __cplusplus || (defined __STDC__ && __STDC__)
+# define __ptr_t	void *
 #else /* Not C++ or ANSI C.  */
-#undef	const
-#define	const
-#define	__ptr_t	char *
+# undef	const
+# define const
+# define __ptr_t	char *
 #endif /* C++ or ANSI C.  */
 
-#if defined (HAVE_STRING_H) || defined (_LIBC)
-#include <string.h>
+#ifndef __P
+# if defined __GNUC__ || (defined __STDC__ && __STDC__)
+#  define __P(args) args
+# else
+#  define __P(args) ()
+# endif  /* GCC.  */
+#endif  /* Not __P.  */
+
+#if defined HAVE_STRING_H || defined _LIBC
+# include <string.h>
 #endif
 
 #undef memcmp
 
 #ifdef _LIBC
 
-#include <memcopy.h>
+# include <memcopy.h>
 
 #else	/* Not in the GNU C library.  */
 
-#include <sys/types.h>
+# include <sys/types.h>
 
 /* Type to use for aligned memory operations.
    This should normally be the biggest type supported by a single load
    and store.  Must be an unsigned type.  */
-#define	op_t	unsigned long int
-#define OPSIZ	(sizeof(op_t))
+# define op_t	unsigned long int
+# define OPSIZ	(sizeof(op_t))
 
 /* Threshold value for when to enter the unrolled loops.  */
-#define	OP_T_THRES	16
+# define OP_T_THRES	16
 
 /* Type to use for unaligned operations.  */
 typedef unsigned char byte;
 
-#ifndef WORDS_BIGENDIAN
-#define MERGE(w0, sh_1, w1, sh_2) (((w0) >> (sh_1)) | ((w1) << (sh_2)))
-#else
-#define MERGE(w0, sh_1, w1, sh_2) (((w0) << (sh_1)) | ((w1) >> (sh_2)))
-#endif
+# ifndef WORDS_BIGENDIAN
+#  define MERGE(w0, sh_1, w1, sh_2) (((w0) >> (sh_1)) | ((w1) << (sh_2)))
+# else
+#  define MERGE(w0, sh_1, w1, sh_2) (((w0) << (sh_1)) | ((w1) >> (sh_2)))
+# endif
 
 #endif	/* In the GNU C library.  */
 
 #ifdef WORDS_BIGENDIAN
-#define CMP_LT_OR_GT(a, b) ((a) > (b) ? 1 : -1)
+# define CMP_LT_OR_GT(a, b) ((a) > (b) ? 1 : -1)
 #else
-#define CMP_LT_OR_GT(a, b) memcmp_bytes ((a), (b))
+# define CMP_LT_OR_GT(a, b) memcmp_bytes ((a), (b))
 #endif
 
 /* BE VERY CAREFUL IF YOU CHANGE THIS CODE!  */
@@ -90,9 +98,9 @@ typedef unsigned char byte;
 
 static int memcmp_bytes __P((op_t, op_t));
 
-#ifdef  __GNUC__
+# ifdef  __GNUC__
 __inline
-#endif
+# endif
 static int
 memcmp_bytes (a, b)
      op_t a, b;
@@ -376,6 +384,6 @@ memcmp (s1, s2, len)
 }
 
 #ifdef weak_alias
-#undef bcmp
+# undef bcmp
 weak_alias (memcmp, bcmp)
 #endif
diff --git a/sysdeps/generic/pread.c b/sysdeps/generic/pread.c
index 5fdaf7b4af..82548d0272 100644
--- a/sysdeps/generic/pread.c
+++ b/sysdeps/generic/pread.c
@@ -22,7 +22,7 @@
 /* Read NBYTES into BUF from FD at the given position OFFSET without
    changing the file pointer.  Return the number read or -1.  */
 ssize_t
-pread (int fd, void *buf, size_t nbytes, off_t offset)
+__pread (int fd, void *buf, size_t nbytes, off_t offset)
 {
   if (nbytes == 0)
     return 0;
@@ -40,5 +40,6 @@ pread (int fd, void *buf, size_t nbytes, off_t offset)
   __set_errno (ENOSYS);
   return -1;
 }
+weak_alias (__pread, pread)
 stub_warning (pread)
 #include <stub-tag.h>
diff --git a/sysdeps/generic/pread64.c b/sysdeps/generic/pread64.c
index fdf622250b..e1596038ac 100644
--- a/sysdeps/generic/pread64.c
+++ b/sysdeps/generic/pread64.c
@@ -22,7 +22,7 @@
 /* Read NBYTES into BUF from FD at the given position OFFSET without
    changing the file pointer.  Return the number read or -1.  */
 ssize_t
-pread64 (int fd, void *buf, size_t nbytes, off64_t offset)
+__pread64 (int fd, void *buf, size_t nbytes, off64_t offset)
 {
   if (nbytes == 0)
     return 0;
@@ -40,5 +40,6 @@ pread64 (int fd, void *buf, size_t nbytes, off64_t offset)
   __set_errno (ENOSYS);
   return -1;
 }
+weak_alias (__pread64, pread64)
 stub_warning (pread64)
 #include <stub-tag.h>
diff --git a/sysdeps/generic/pwrite.c b/sysdeps/generic/pwrite.c
index 48a1dc6089..8eec560c9d 100644
--- a/sysdeps/generic/pwrite.c
+++ b/sysdeps/generic/pwrite.c
@@ -22,7 +22,7 @@
 /* Write NBYTES of BUF to FD at given position OFFSET without changing
    the file position.  Return the number written, or -1.  */
 ssize_t
-pwrite (int fd, const void *buf, size_t nbytes, off_t offset)
+__pwrite (int fd, const void *buf, size_t nbytes, off_t offset)
 {
   if (nbytes == 0)
     return 0;
@@ -40,5 +40,6 @@ pwrite (int fd, const void *buf, size_t nbytes, off_t offset)
   __set_errno (ENOSYS);
   return -1;
 }
+weak_alias (__pwrite, pwrite)
 stub_warning (pwrite)
 #include <stub-tag.h>
diff --git a/sysdeps/generic/pwrite64.c b/sysdeps/generic/pwrite64.c
index df229f877f..d84b63576a 100644
--- a/sysdeps/generic/pwrite64.c
+++ b/sysdeps/generic/pwrite64.c
@@ -22,7 +22,7 @@
 /* Write NBYTES of BUF to FD at given position OFFSET without changing
    the file position.  Return the number written, or -1.  */
 ssize_t
-pwrite64 (int fd, const void *buf, size_t nbytes, off64_t offset)
+__pwrite64 (int fd, const void *buf, size_t nbytes, off64_t offset)
 {
   if (nbytes == 0)
     return 0;
@@ -40,5 +40,6 @@ pwrite64 (int fd, const void *buf, size_t nbytes, off64_t offset)
   __set_errno (ENOSYS);
   return -1;
 }
+weak_alias (__pwrite64, pwrite64)
 stub_warning (pwrite64)
 #include <stub-tag.h>
diff --git a/sysdeps/i386/i486/bits/string.h b/sysdeps/i386/i486/bits/string.h
index 80fcc48a2b..210bf7f745 100644
--- a/sysdeps/i386/i486/bits/string.h
+++ b/sysdeps/i386/i486/bits/string.h
@@ -979,12 +979,14 @@ __strchr_g (__const char *__s, int __c)
 }
 
 
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
 /* Find the first occurrence of C in S.  This is the BSD name.  */
-#define _HAVE_STRING_ARCH_index 1
-#define index(s, c) \
+# define _HAVE_STRING_ARCH_index 1
+# define index(s, c) \
   (__extension__ (__builtin_constant_p (c)				      \
 		  ? __strchr_c (s, ((c) & 0xff) << 8)			      \
 		  : __strchr_g (s, c)))
+#endif
 
 
 /* Find the last occurrence of C in S.  */
@@ -1075,12 +1077,14 @@ __strrchr_g (__const char *__s, int __c)
 #endif
 
 
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
 /* Find the last occurrence of C in S.  This is the BSD name.  */
-#define _HAVE_STRING_ARCH_rindex 1
-#define rindex(s, c) \
+# define _HAVE_STRING_ARCH_rindex 1
+# define rindex(s, c) \
   (__extension__ (__builtin_constant_p (c)				      \
 		  ? __strrchr_c (s, ((c) & 0xff) << 8)			      \
 		  : __strrchr_g (s, c)))
+#endif
 
 
 /* Return the length of the initial segment of S which
diff --git a/sysdeps/libm-ieee754/s_llrintl.c b/sysdeps/libm-ieee754/s_llrintl.c
index 29fc3a300d..d3b9b12d76 100644
--- a/sysdeps/libm-ieee754/s_llrintl.c
+++ b/sysdeps/libm-ieee754/s_llrintl.c
@@ -34,7 +34,7 @@ long long int
 __llrintl (long double x)
 {
   int32_t se,j0;
-  u_int32_t i0, i1, i;
+  u_int32_t i0, i1;
   long long int result;
   volatile long double w;
   long double t;
@@ -45,23 +45,11 @@ __llrintl (long double x)
   sx = (se >> 15) & 1;
   j0 = (se & 0x7fff) - 0x3fff;
 
-  if (j0 < 31)
+  if (j0 < (int32_t) (8 * sizeof (long long int)))
     {
       if (j0 < -1)
 	return 0;
-      else
-	{
-	  w = two63[sx] + x;
-	  t = w - two63[sx];
-	  GET_LDOUBLE_WORDS (se, i0, i1, t);
-	  j0 = (se & 0x7fff) - 0x3fff;
-
-	  result = i0 >> (31 - j0);
-	}
-    }
-  else if (j0 < (int32_t) (8 * sizeof (long long int)))
-    {
-      if (j0 >= 63)
+      else if (j0 >= 63)
 	result = ((long long int) i0 << (j0 - 31)) | (i1 << (j0 - 63));
       else
 	{
@@ -70,7 +58,10 @@ __llrintl (long double x)
 	  GET_LDOUBLE_WORDS (se, i0, i1, t);
 	  j0 = (se & 0x7fff) - 0x3fff;
 
-	  result = ((long long int) i0 << (j0 - 31)) | (j >> (63 - j0));
+	  if (j0 < 31)
+	    result = i0 >> (31 - j0);
+	  else
+	    result = ((long long int) i0 << (j0 - 31)) | (i1 >> (63 - j0));
 	}
     }
   else
diff --git a/sysdeps/libm-ieee754/s_lrintl.c b/sysdeps/libm-ieee754/s_lrintl.c
index 8607851669..5a41427f72 100644
--- a/sysdeps/libm-ieee754/s_lrintl.c
+++ b/sysdeps/libm-ieee754/s_lrintl.c
@@ -34,7 +34,7 @@ long int
 __lrintl (long double x)
 {
   int32_t se,j0;
-  u_int32_t i0,i1,i;
+  u_int32_t i0, i1;
   long int result;
   volatile long double w;
   long double t;
@@ -70,7 +70,7 @@ __lrintl (long double x)
 	  GET_LDOUBLE_WORDS (se, i0, i1, t);
 	  j0 = (se & 0x7fff) - 0x3fff;
 
-	  result = ((long int) i0 << (j0 - 31)) | (j >> (63 - j0));
+	  result = ((long int) i0 << (j0 - 31)) | (i1 >> (63 - j0));
 	}
     }
   else
diff --git a/sysdeps/libm-ieee754/s_nextafterxf.c b/sysdeps/libm-ieee754/s_nextafterxf.c
index 7e870805e2..a4726b41b8 100644
--- a/sysdeps/libm-ieee754/s_nextafterxf.c
+++ b/sysdeps/libm-ieee754/s_nextafterxf.c
@@ -25,7 +25,7 @@ static char rcsid[] = "$NetBSD: $";
 #else
 	float __nextafterxf(x,y)
 	float x;
-	log double y;
+	long double y;
 #endif
 {
 	int32_t hx,ix,iy;
diff --git a/sysdeps/m68k/fpu/bits/mathinline.h b/sysdeps/m68k/fpu/bits/mathinline.h
index 1e68ea00c0..c3ed76c0de 100644
--- a/sysdeps/m68k/fpu/bits/mathinline.h
+++ b/sysdeps/m68k/fpu/bits/mathinline.h
@@ -76,12 +76,16 @@
 /* This is used when defining the functions themselves.  Define them with
    __ names, and with `static inline' instead of `extern inline' so the
    bodies will always be used, never an external function call.  */
-# define __m81_u(x)		__CONCAT(__,x)
-# define __m81_inline		static __inline
+#define __m81_u(x)		__CONCAT(__,x)
+#define __m81_inline		static __inline
 #else
-# define __m81_u(x)		x
-# define __m81_inline		extern __inline
-# define __M81_MATH_INLINES	1
+#define __m81_u(x)		x
+#ifdef __cplusplus
+#define __m81_inline		__inline
+#else
+#define __m81_inline		extern __inline
+#endif
+#define __M81_MATH_INLINES	1
 #endif
 
 /* Define a const math function.  */
@@ -95,12 +99,12 @@
    is the name of the fpu operation (without leading f).  */
 
 #if defined __USE_MISC || defined __USE_ISOC9X
-# define __inline_mathop(func, op)			\
+#define __inline_mathop(func, op)			\
   __inline_mathop1(double, func, op)			\
   __inline_mathop1(float, __CONCAT(func,f), op)		\
   __inline_mathop1(long double, __CONCAT(func,l), op)
 #else
-# define __inline_mathop(func, op)			\
+#define __inline_mathop(func, op)			\
   __inline_mathop1(double, func, op)
 #endif
 
@@ -309,13 +313,19 @@ __m81_defun (int, __CONCAT(__signbit,s), (float_type __value))		  \
 }									  \
 									  \
 __m81_defun (float_type, __CONCAT(__scalbn,s),				  \
-	     (float_type __x, long int __n))				  \
+	     (float_type __x, int __n))					  \
 {									  \
   float_type __result;							  \
   __asm ("fscale%.l %1, %0" : "=f" (__result) : "dmi" (__n), "0" (__x));  \
   return __result;							  \
 }									  \
 									  \
+__m81_defun (float_type, __CONCAT(__scalbln,s),				  \
+	     (float_type __x, long int __n))				  \
+{									  \
+  return __CONCAT(__scalbn,s) (__x, __n);				  \
+}									  \
+									  \
 __m81_defun (float_type, __CONCAT(__nearbyint,s), (float_type __x))	  \
 {									  \
   float_type __result;							  \
@@ -330,12 +340,26 @@ __m81_defun (float_type, __CONCAT(__nearbyint,s), (float_type __x))	  \
   return __result;							  \
 }									  \
 									  \
+__m81_defun (long int, __CONCAT(__lrint,s), (float_type __x))		  \
+{									  \
+  long int __result;							  \
+  __asm ("fmove%.l %1, %0" : "=dm" (__result) : "f" (__x));		  \
+  return __result;							  \
+}									  \
+									  \
 __m81_inline void							  \
 __m81_u(__CONCAT(__sincos,s))(float_type __x, float_type *__sinx,	  \
 			      float_type *__cosx)			  \
 {									  \
   __asm ("fsincos%.x %2,%1:%0"						  \
 	 : "=f" (*__sinx), "=f" (*__cosx) : "f" (__x));			  \
+}									  \
+									  \
+__m81_inline float_type							  \
+__m81_u(__CONCAT(__fma,s))(float_type __x, float_type __y,		  \
+			   float_type __z)				  \
+{									  \
+  return (__x * __y) + __z;						  \
 }
 
 /* This defines the three variants of the inline functions.  */
@@ -344,17 +368,12 @@ __inline_functions (float,f)
 __inline_functions (long double,l)
 #undef __inline_functions
 
-__m81_defun (long int, __lrint, (long double __x))
-{
-  long int __result;
-  __asm ("fmove%.l %1, %0" : "=dm" (__result) : "f" (__x));
-  return __result;
-}
-
 #if !defined __NO_MATH_INLINES && defined __OPTIMIZE__
 
 /* Define inline versions of the user visible functions.  */
 
+/* Note that there must be no whitespace before the argument passed for
+   NAME, to make token pasting work correctly with -traditional.  */
 #define __inline_forward_c(rettype, name, args1, args2)	\
 extern __inline rettype __attribute__((__const__))	\
 name args1						\
@@ -375,7 +394,8 @@ __inline_forward_c(double,ceil, (double __x), (__x))
 #ifdef __USE_MISC
 __inline_forward_c(int,isinf, (double __value), (__value))
 __inline_forward_c(int,finite, (double __value), (__value))
-__inline_forward_c(double,scalbn, (double __x, long int __n), (__x, __n))
+__inline_forward_c(double,scalbn, (double __x, int __n), (__x, __n))
+__inline_forward_c(double,scalbln, (double __x, long int __n), (__x, __n))
 #endif
 #if defined __USE_MISC || defined __USE_XOPEN
 #ifndef __USE_ISOC9X /* Conflict with macro of same name.  */
@@ -384,6 +404,9 @@ __inline_forward_c(int,isnan, (double __value), (__value))
 #endif
 #ifdef __USE_ISOC9X
 __inline_forward_c(double,nearbyint, (double __value), (__value))
+__inline_forward_c(long int,lrint, (double __value), (__value))
+__inline_forward_c(double,fma, (double __x, double __y, double __z),
+		   (__x, __y, __z))
 #endif
 #ifdef __USE_GNU
 __inline_forward(void,sincos, (double __x, double *__sinx, double *__cosx),
@@ -399,11 +422,15 @@ __inline_forward_c(float,ceilf, (float __x), (__x))
 #ifdef __USE_MISC
 __inline_forward_c(int,isinff, (float __value), (__value))
 __inline_forward_c(int,finitef, (float __value), (__value))
-__inline_forward_c(float,scalbnf, (float __x, long int __n), (__x, __n))
+__inline_forward_c(float,scalbnf, (float __x, int __n), (__x, __n))
+__inline_forward_c(float,scalblnf, (float __x, long int __n), (__x, __n))
 __inline_forward_c(int,isnanf, (float __value), (__value))
 #endif
 #ifdef __USE_ISOC9X
 __inline_forward_c(float,nearbyintf, (float __value), (__value))
+__inline_forward_c(long int,lrintf, (float __value), (__value))
+__inline_forward_c(float,fmaf, (float __x, float __y, float __z),
+		   (__x, __y, __z))
 #endif
 #ifdef __USE_GNU
 __inline_forward(void,sincosf, (float __x, float *__sinx, float *__cosx),
@@ -417,13 +444,17 @@ __inline_forward_c(long double,ceill, (long double __x), (__x))
 #ifdef __USE_MISC
 __inline_forward_c(int,isinfl, (long double __value), (__value))
 __inline_forward_c(int,finitel, (long double __value), (__value))
-__inline_forward_c(long double,scalbnl, (long double __x, long int __n),
+__inline_forward_c(long double,scalbnl, (long double __x, int __n), (__x, __n))
+__inline_forward_c(long double,scalblnl, (long double __x, long int __n),
 		   (__x, __n))
 __inline_forward_c(int,isnanl, (long double __value), (__value))
 #endif
 #ifdef __USE_ISOC9X
 __inline_forward_c(long double,nearbyintl, (long double __value), (__value))
-__inline_forward_c(long int,lrint, (long double __value), (__value))
+__inline_forward_c(long int,lrintl, (long double __value), (__value))
+__inline_forward_c(long double,fmal,
+		   (long double __x, long double __y, long double __z),
+		   (__x, __y, __z))
 #endif
 #ifdef __USE_GNU
 __inline_forward(void,sincosl,
diff --git a/sysdeps/m68k/fpu/s_lrint.c b/sysdeps/m68k/fpu/s_lrint.c
index a7044113af..511d28880c 100644
--- a/sysdeps/m68k/fpu/s_lrint.c
+++ b/sysdeps/m68k/fpu/s_lrint.c
@@ -22,10 +22,20 @@
 #define __LIBC_M81_MATH_INLINES
 #include <math.h>
 
+#ifndef suffix
+#define suffix /*empty*/
+#endif
+#ifndef float_type
+#define float_type double
+#endif
+
+#define CONCATX(a,b) __CONCAT(a,b)
+
 long int
-__lrint (long double x)
+CONCATX(__lrint,suffix) (float_type x)
 {
-  return __m81_u(__lrint) (x);
+  return __m81_u(CONCATX(__lrint,suffix)) (x);
 }
 
-weak_alias (__lrint, lrint)
+#define weak_aliasx(a,b) weak_alias(a,b)
+weak_aliasx (CONCATX(__lrint,suffix), CONCATX(lrint,suffix))
diff --git a/sysdeps/m68k/fpu/s_lrintf.c b/sysdeps/m68k/fpu/s_lrintf.c
new file mode 100644
index 0000000000..44924cb82f
--- /dev/null
+++ b/sysdeps/m68k/fpu/s_lrintf.c
@@ -0,0 +1,3 @@
+#define suffix f
+#define float_type float
+#include <s_lrint.c>
diff --git a/sysdeps/m68k/fpu/s_lrintl.c b/sysdeps/m68k/fpu/s_lrintl.c
new file mode 100644
index 0000000000..cd0bd23b8a
--- /dev/null
+++ b/sysdeps/m68k/fpu/s_lrintl.c
@@ -0,0 +1,3 @@
+#define suffix l
+#define float_type long double
+#include <s_lrint.c>
diff --git a/sysdeps/m68k/fpu/s_scalbln.c b/sysdeps/m68k/fpu/s_scalbln.c
new file mode 100644
index 0000000000..1009713fbc
--- /dev/null
+++ b/sysdeps/m68k/fpu/s_scalbln.c
@@ -0,0 +1,2 @@
+/* Nothing to do.  This function is the same as scalbn.  So we define an
+   alias.  */
diff --git a/sysdeps/m68k/fpu/s_scalblnf.c b/sysdeps/m68k/fpu/s_scalblnf.c
new file mode 100644
index 0000000000..5e558c3540
--- /dev/null
+++ b/sysdeps/m68k/fpu/s_scalblnf.c
@@ -0,0 +1,2 @@
+/* Nothing to do.  This function is the same as scalbnf.  So we define an
+   alias.  */
diff --git a/sysdeps/m68k/fpu/s_scalblnl.c b/sysdeps/m68k/fpu/s_scalblnl.c
new file mode 100644
index 0000000000..cda2ec11c8
--- /dev/null
+++ b/sysdeps/m68k/fpu/s_scalblnl.c
@@ -0,0 +1,2 @@
+/* Nothing to do.  This function is the same as scalbnl.  So we define an
+   alias.  */
diff --git a/sysdeps/m68k/fpu/s_scalbn.c b/sysdeps/m68k/fpu/s_scalbn.c
index d3ba27fa46..1b219ec108 100644
--- a/sysdeps/m68k/fpu/s_scalbn.c
+++ b/sysdeps/m68k/fpu/s_scalbn.c
@@ -17,10 +17,22 @@
    Boston, MA 02111-1307, USA.  */
 
 #define __LIBC_M81_MATH_INLINES
+#define scalbln __no_scalbln_decl
+#define scalblnf __no_scalblnf_decl
+#define scalblnl __no_scalblnl_decl
+#define __scalbln __no__scalbln_decl
+#define __scalblnf __no__scalblnf_decl
+#define __scalblnl __no__scalblnl_decl
 #include <math.h>
-
-#ifndef FUNC
-#define FUNC scalbn
+#undef scalbln
+#undef scalblnf
+#undef scalblnl
+#undef __scalbln
+#undef __scalblnf
+#undef __scalblnl
+
+#ifndef suffix
+#define suffix /*empty*/
 #endif
 #ifndef float_type
 #define float_type double
@@ -29,12 +41,15 @@
 #define __CONCATX(a,b) __CONCAT(a,b)
 
 float_type
-__CONCATX(__,FUNC) (x, exp)
+__CONCATX(__scalbn,suffix) (x, exp)
      float_type x;
-     long int exp;
+     int exp;
 {
-  return __m81_u(__CONCATX(__,FUNC))(x, exp);
+  return __m81_u(__CONCATX(__scalbn,suffix))(x, exp);
 }
 
 #define weak_aliasx(a,b) weak_alias(a,b)
-weak_aliasx (__CONCATX(__,FUNC), FUNC)
+#define strong_aliasx(a,b) strong_alias(a,b)
+weak_aliasx (__CONCATX(__scalbn,suffix), __CONCATX(scalbn,suffix))
+strong_aliasx (__CONCATX(__scalbn,suffix), __CONCATX(__scalbln,suffix))
+weak_aliasx (__CONCATX(__scalbn,suffix), __CONCATX(scalbln,suffix))
diff --git a/sysdeps/m68k/fpu/s_scalbnf.c b/sysdeps/m68k/fpu/s_scalbnf.c
index 33459718e9..547971836a 100644
--- a/sysdeps/m68k/fpu/s_scalbnf.c
+++ b/sysdeps/m68k/fpu/s_scalbnf.c
@@ -1,5 +1,3 @@
-#ifndef FUNC
-#define FUNC scalbnf
-#endif
+#define suffix f
 #define float_type float
 #include <s_scalbn.c>
diff --git a/sysdeps/m68k/fpu/s_scalbnl.c b/sysdeps/m68k/fpu/s_scalbnl.c
index c6ad95079c..874bafb04b 100644
--- a/sysdeps/m68k/fpu/s_scalbnl.c
+++ b/sysdeps/m68k/fpu/s_scalbnl.c
@@ -1,5 +1,3 @@
-#ifndef FUNC
-#define FUNC scalbnl
-#endif
+#define suffix l
 #define float_type long double
 #include <s_scalbn.c>
diff --git a/sysdeps/m68k/sys/ucontext.h b/sysdeps/m68k/sys/ucontext.h
new file mode 100644
index 0000000000..4776e7d821
--- /dev/null
+++ b/sysdeps/m68k/sys/ucontext.h
@@ -0,0 +1,108 @@
+/* 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.  */
+
+/* System V/m68k ABI compliant context switching support.  */
+
+#ifndef _SYS_UCONTEXT_H
+#define _SYS_UCONTEXT_H	1
+
+#include <features.h>
+#include <signal.h>
+
+/* Type for general register.  */
+typedef int greg_t;
+
+/* Number of general registers.  */
+#define NGREG	18
+
+/* Container for all general registers.  */
+typedef greg_t gregset_t[NGREG];
+
+/* Number of each register is the `gregset_t' array.  */
+enum
+{
+  R_D0 = 0,
+#define R_D0	R_D0
+  R_D1 = 1,
+#define R_D1	R_D1
+  R_D2 = 2,
+#define R_D2	R_D2
+  R_D3 = 3,
+#define R_D3	R_D3
+  R_D4 = 4,
+#define R_D4	R_D4
+  R_D5 = 5,
+#define R_D5	R_D5
+  R_D6 = 6,
+#define R_D6	R_D6
+  R_D7 = 7,
+#define R_D7	R_D7
+  R_A0 = 8,
+#define R_A0	R_A0
+  R_A1 = 9,
+#define R_A1	R_A1
+  R_A2 = 10,
+#define R_A2	R_A2
+  R_A3 = 11,
+#define R_A3	R_A3
+  R_A4 = 12,
+#define R_A4	R_A4
+  R_A5 = 13,
+#define R_A5	R_A5
+  R_A6 = 14,
+#define R_A6	R_A6
+  R_A7 = 15,
+#define R_A7	R_A7
+  R_SP = 15,
+#define R_SP	R_SP
+  R_PC = 16,
+#define R_PC	R_PC
+  R_PS = 17
+#define R_PS	R_PS
+};
+
+/* Structure to describe FPU registers.  */
+typedef struct fpregset
+{
+  int f_pcr;
+  int f_psr;
+  int f_fpiaddr;
+  int f_fpregs[8][3];
+} fpregset_t;
+
+/* Context to describe whole processor state.  */
+typedef struct
+{
+  int version;
+  gregset_t gregs;
+} mcontext_t;
+
+#define MCONTEXT_VERSION 1
+
+/* Userlevel context.  */
+typedef struct ucontext
+{
+  unsigned long int uc_flags;
+  struct ucontext *uc_links;
+  __sigset_t uc_sigmask;
+  stack_t uc_stack;
+  mcontext_t uc_mcontext;
+  long int uc_filler[201];
+} ucontext_t;
+
+#endif /* sys/ucontext.h */
diff --git a/sysdeps/posix/pread.c b/sysdeps/posix/pread.c
index 300aabac65..22b8ca82bd 100644
--- a/sysdeps/posix/pread.c
+++ b/sysdeps/posix/pread.c
@@ -23,7 +23,7 @@
 #include <unistd.h>
 
 ssize_t
-pread (int fd, void *buf, size_t nbyte, off_t offset)
+__pread (int fd, void *buf, size_t nbyte, off_t offset)
 {
   /* Since we must not change the file pointer preserve the value so that
      we can restore it later.  */
@@ -54,3 +54,7 @@ pread (int fd, void *buf, size_t nbyte, off_t offset)
 
   return result;
 }
+
+#ifndef __pread
+weak_alias (__pread, pread)
+#endif
diff --git a/sysdeps/posix/pread64.c b/sysdeps/posix/pread64.c
new file mode 100644
index 0000000000..00b1f33bf2
--- /dev/null
+++ b/sysdeps/posix/pread64.c
@@ -0,0 +1,60 @@
+/* Read block from given position in file without changing file pointer.
+   POSIX version.
+   Copyright (C) 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+   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 <unistd.h>
+
+ssize_t
+__pread64 (int fd, void *buf, size_t nbyte, off64_t offset)
+{
+  /* Since we must not change the file pointer preserve the value so that
+     we can restore it later.  */
+  int save_errno;
+  ssize_t result;
+  off64_t old_offset = lseek64 (fd, 0, SEEK_CUR);
+  if (old_offset == (off64_t) -1)
+    return -1;
+
+  /* Set to wanted position.  */
+  if (lseek64 (fd, offset, SEEK_SET) == (off64_t) -1)
+    return -1;
+
+  /* Write out the data.  */
+  result = read (fd, buf, nbyte);
+
+  /* Now we have to restore the position.  If this fails we have to
+     return this as an error.  But if the writing also failed we
+     return this error.  */
+  save_errno = errno;
+  if (lseek64 (fd, old_offset, SEEK_SET) == (off64_t) -1)
+    {
+      if (result == -1)
+	__set_errno (save_errno);
+      return -1;
+    }
+  __set_errno (save_errno);
+
+  return result;
+}
+
+#ifndef __pread64
+weak_alias (__pread64, pread64)
+#endif
diff --git a/sysdeps/posix/pwrite.c b/sysdeps/posix/pwrite.c
index 7c1ed45cca..65806a2e68 100644
--- a/sysdeps/posix/pwrite.c
+++ b/sysdeps/posix/pwrite.c
@@ -23,7 +23,7 @@
 #include <unistd.h>
 
 ssize_t
-pwrite (int fd, const void *buf, size_t nbyte, off_t offset)
+__pwrite (int fd, const void *buf, size_t nbyte, off_t offset)
 {
   /* Since we must not change the file pointer preserve the value so that
      we can restore it later.  */
@@ -54,3 +54,4 @@ pwrite (int fd, const void *buf, size_t nbyte, off_t offset)
 
   return result;
 }
+weak_alias (__pwrite, pwrite)
diff --git a/sysdeps/posix/pwrite64.c b/sysdeps/posix/pwrite64.c
new file mode 100644
index 0000000000..4045ed4344
--- /dev/null
+++ b/sysdeps/posix/pwrite64.c
@@ -0,0 +1,59 @@
+/* Write block to given position in file without changing file pointer.
+   POSIX version.
+   Copyright (C) 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+   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 <unistd.h>
+
+ssize_t
+__pwrite64 (int fd, const void *buf, size_t nbyte, off64_t offset)
+{
+  /* Since we must not change the file pointer preserve the value so that
+     we can restore it later.  */
+  int save_errno;
+  ssize_t result;
+  off64_t old_offset = lseek64 (fd, 0, SEEK_CUR);
+  if (old_offset == (off64_t) -1)
+    return -1;
+
+  /* Set to wanted position.  */
+  if (lseek64 (fd, offset, SEEK_SET) == (off64_t) -1)
+    return -1;
+
+  /* Write out the data.  */
+  result = write (fd, buf, nbyte);
+
+  /* Now we have to restore the position.  If this fails we have to
+     return this as an error.  But if the writing also failed we
+     return this error.  */
+  save_errno = errno;
+  if (lseek64 (fd, old_offset, SEEK_SET) == (off64_t) -1)
+    {
+      if (result == -1)
+	__set_errno (save_errno);
+      return -1;
+    }
+  __set_errno (save_errno);
+
+  return result;
+}
+#ifndef __pwrite64
+weak_alias (__pwrite64, pwrite64)
+#endif
diff --git a/sysdeps/powerpc/bits/fenv.h b/sysdeps/powerpc/bits/fenv.h
index 8c26a2548f..9bb6600324 100644
--- a/sysdeps/powerpc/bits/fenv.h
+++ b/sysdeps/powerpc/bits/fenv.h
@@ -144,7 +144,7 @@ extern const fenv_t *__fe_nomask_env __P ((void));
 # define FE_NOMASK_ENV	(__fe_nomask_env ())
 #endif
 
-#ifdef __OPTIMIZE__
+#if defined __OPTIMIZE__ && !defined _SOFT_FLOAT
 /* Inline definition for fegetround.  */
 # define fegetround() \
   (__extension__  ({ int __fegetround_result;				      \
@@ -175,4 +175,4 @@ extern const fenv_t *__fe_nomask_env __P ((void));
 			    : : "i"(32 - __builtin_ffs (__excepts)));	      \
 		     } else						      \
 		       (feclearexcept) (__excepts); }))
-#endif /* __OPTIMIZE__ */
+#endif /* __OPTIMIZE__ && !_SOFT_FLOAT */
diff --git a/sysdeps/powerpc/bits/mathinline.h b/sysdeps/powerpc/bits/mathinline.h
index d7cabaf28b..24f186adf1 100644
--- a/sysdeps/powerpc/bits/mathinline.h
+++ b/sysdeps/powerpc/bits/mathinline.h
@@ -32,9 +32,9 @@ __sgn1 (double __x)
 {
   return __x >= 0.0 ? 1.0 : -1.0;
 }
-#endif /* __NO_MATH_INLINES && __OPTIMZE__ */
+#endif /* !__NO_MATH_INLINES && __OPTIMIZE__ */
 
-#if __USE_ISOC9X
+#if __USE_ISOC9X && !defined _SOFT_FLOAT
 # define __unordered_cmp(x, y) \
   (__extension__							      \
    ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y);			      \
@@ -48,6 +48,6 @@ __sgn1 (double __x)
 # define islessequal(x, y) ((__unordered_cmp (x, y) & 0xA) != 0)
 # define islessgreater(x, y) ((__unordered_cmp (x, y) & 0xC) != 0)
 # define isunordered(x, y) (__unordered_cmp (x, y) & 1)
-#endif /* __USE_ISOC9X */
+#endif /* __USE_ISOC9X && !_SOFT_FLOAT */
 
 #endif /* __GNUC__  */
diff --git a/sysdeps/powerpc/dl-machine.h b/sysdeps/powerpc/dl-machine.h
index 6ab79e79ac..6857f214a9 100644
--- a/sysdeps/powerpc/dl-machine.h
+++ b/sysdeps/powerpc/dl-machine.h
@@ -243,8 +243,7 @@ _dl_prof_resolve:
  # ...unwind the stack frame, and jump to the PLT entry we updated.
 	addi 1,1,48
 	bctr
-0:
-	.size	 _dl_prof_resolve,0b-_dl_prof_resolve
+	.size	 _dl_prof_resolve,.-_dl_prof_resolve
  # Undo '.section text'.
 	.previous
 ");
@@ -741,7 +740,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
     }
   else if (rinfo == R_PPC_JMP_SLOT)
     {
-      elf_machine_fixup_plt (map, reloc, reloc_addr, finalvalue);
+      elf_machine_fixup_plt (map, reloc, reloc_addr, finaladdr);
     }
   else
     {
diff --git a/sysdeps/sparc/sparc32/elf/start.S b/sysdeps/sparc/sparc32/elf/start.S
index 8e01b30fc7..24715e68be 100644
--- a/sysdeps/sparc/sparc32/elf/start.S
+++ b/sysdeps/sparc/sparc32/elf/start.S
@@ -54,7 +54,7 @@ _start:
      argument info starts after one register window (16 words) past the SP.  */
 	ld	[%sp+22*4], %o0
 	add	%sp, 23*4, %o1
-	sll	%o0, 4, %o2
+	sll	%o0, 2, %o2
 	add	%o2, %o1, %o2
 	sethi	%hi(__environ), %g2
 	add	%o2, 4, %o2
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index 4bfc3eb352..8db8094dc1 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -76,6 +76,10 @@ sysdep_headers += netinet/in_systm.h netinet/udp.h \
 		  sys/socketvar.h
 endif
 
+ifeq ($(subdir),posix)
+sysdep_routines += s_pread64 s_pwrite64
+endif
+
 # Don't compile the ctype glue code, since there is no old non-GNU C library.
 inhibit-glue = yes
 
diff --git a/sysdeps/unix/sysv/linux/alpha/pread64.c b/sysdeps/unix/sysv/linux/alpha/pread64.c
new file mode 100644
index 0000000000..b7f298dea8
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/alpha/pread64.c
@@ -0,0 +1 @@
+/* Empty since the pread syscall is equivalent.  */
diff --git a/sysdeps/unix/sysv/linux/alpha/pwrite64.c b/sysdeps/unix/sysv/linux/alpha/pwrite64.c
new file mode 100644
index 0000000000..b7f298dea8
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/alpha/pwrite64.c
@@ -0,0 +1 @@
+/* Empty since the pread syscall is equivalent.  */
diff --git a/sysdeps/unix/sysv/linux/alpha/syscalls.list b/sysdeps/unix/sysv/linux/alpha/syscalls.list
index 71407062fb..9e4cd39a8f 100644
--- a/sysdeps/unix/sysv/linux/alpha/syscalls.list
+++ b/sysdeps/unix/sysv/linux/alpha/syscalls.list
@@ -21,6 +21,8 @@ getpeername	-	getpeername	3	__getpeername	getpeername
 getpriority	-	getpriority	2	__getpriority	getpriority
 mmap		-	mmap		6	__mmap		mmap
 llseek		EXTRA	lseek		3	llseek
+pread		EXTRA	pread		4	__pread		pread __pread64 pread64
+pwrite		EXTRA	pwrite		4	__pwrite	pwrite __pwrite64 pwrite64
 
 # these are actually common with the x86:
 fstatfs		-	fstatfs		2	__fstatfs	fstatfs
diff --git a/sysdeps/unix/sysv/linux/bits/socket.h b/sysdeps/unix/sysv/linux/bits/socket.h
index 2a8d6ed004..8f859d2e3e 100644
--- a/sysdeps/unix/sysv/linux/bits/socket.h
+++ b/sysdeps/unix/sysv/linux/bits/socket.h
@@ -136,10 +136,10 @@ struct msghdr
     socklen_t msg_namelen;	/* Length of address data.  */
 
     struct iovec *msg_iov;	/* Vector of data to send/receive into.  */
-    int 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). */
-    socklen_t msg_controllen;	/* Ancillary data buffer length.  */
+    size_t msg_controllen;	/* Ancillary data buffer length.  */
 
     int msg_flags;		/* Flags on received message.  */
   };
@@ -147,7 +147,7 @@ struct msghdr
 /* Structure used for storage of ancillary data object information.  */
 struct cmsghdr
   {
-    socklen_t cmsg_len;		/* Length of data in cmsg_data plus length
+    size_t cmsg_len;		/* Length of data in cmsg_data plus length
 				   of cmsghdr structure.  */
     int cmsg_level;		/* Originating protocol.  */
     int cmsg_type;		/* Protocol specific type.  */
@@ -195,6 +195,16 @@ __cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg)
   return (struct cmsghdr *) __p;
 }
 
+/* Socket level message types.  This must match the definitions in
+   <linux/socket.h>.  */
+enum
+  {
+    SCM_RIGHTS = 0x01,		/* Data array contains access rights.  */
+#define SCM_RIGHTS SCM_RIGHTS
+    __SCM_CREDENTIALS = 0x02,	/* Data array is `struct ucred'.  */
+    __SCM_CONNECT = 0x03	/* Data array is `struct scm_connect'.  */
+  };
+
 
 /* Get socket manipulation related informations from kernel headers.  */
 #include <asm/socket.h>
diff --git a/sysdeps/unix/sysv/linux/net/if_arp.h b/sysdeps/unix/sysv/linux/net/if_arp.h
index d784f0cfc7..80f4516344 100644
--- a/sysdeps/unix/sysv/linux/net/if_arp.h
+++ b/sysdeps/unix/sysv/linux/net/if_arp.h
@@ -69,7 +69,7 @@ struct arphdr
 
 /* ARP protocol HARDWARE identifiers. */
 #define ARPHRD_NETROM	0		/* From KA9Q: NET/ROM pseudo. */
-#define ARPHRD_ETHER 	1		/* Ethernet 10Mbps.  */
+#define ARPHRD_ETHER 	1		/* Ethernet 10/100Mbps.  */
 #define	ARPHRD_EETHER	2		/* Experimental Ethernet.  */
 #define	ARPHRD_AX25	3		/* AX.25 Level 2.  */
 #define	ARPHRD_PRONET	4		/* PROnet token ring.  */
@@ -92,6 +92,7 @@ struct arphdr
 #define ARPHRD_PPP	512
 #define ARPHRD_HDLC	513		/* (Cisco) HDLC.  */
 #define ARPHRD_LAPB	516		/* LAPB.  */
+#define ARPHRD_ASH	517		/* ASH.  */
 
 #define ARPHRD_TUNNEL	768		/* IPIP tunnel.  */
 #define ARPHRD_TUNNEL6	769		/* IPIP6 tunnel.  */
diff --git a/sysdeps/unix/sysv/linux/net/if_packet.h b/sysdeps/unix/sysv/linux/net/if_packet.h
new file mode 100644
index 0000000000..60155eeac3
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/net/if_packet.h
@@ -0,0 +1,26 @@
+/* Definitions for use with Linux SOCK_PACKET sockets.
+   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 __IF_PACKET_H
+#define __IF_PACKET_H
+
+/* For now we can just use the kernel definitions.  */
+#include <linux/if_packet.h>
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/pread.c b/sysdeps/unix/sysv/linux/pread.c
new file mode 100644
index 0000000000..eeb26eb663
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/pread.c
@@ -0,0 +1,28 @@
+/* Copyright (C) 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+   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 <unistd.h>
+
+ssize_t
+__pread (int fd, void *buf, size_t nbytes, off_t offset)
+{
+  return __pread64 (fd, buf, nbytes, (off64_t) offset);
+}
+
+weak_alias (__pread, pread)
diff --git a/sysdeps/unix/sysv/linux/pread64.c b/sysdeps/unix/sysv/linux/pread64.c
new file mode 100644
index 0000000000..e2505dbaa4
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/pread64.c
@@ -0,0 +1,53 @@
+/* Copyright (C) 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+   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 <unistd.h>
+
+extern ssize_t __syscall_pread64 (int fd, void *buf, size_t count,
+				  off_t offset_hi, off_t offset_lo);
+
+static ssize_t __emulate_pread64 (int fd, void *buf, size_t count,
+				  off64_t offset) internal_function;
+
+
+ssize_t
+__pread64 (fd, buf, count, offset)
+     int fd;
+     void *buf;
+     size_t count;
+     off64_t offset;
+{
+  ssize_t result;
+
+  /* First try the syscall.  */
+  result = __syscall_pread64 (fd, buf, count, (off_t) (offset >> 32),
+			      (off_t) (offset & 0xffffffff));
+  if (result == -1 && errno == ENOSYS)
+    /* No system call available.  Use the emulation.  */
+    result = __emulate_pread64 (fd, buf, count, offset);
+
+  return result;
+}
+
+weak_alias (__pread64, pread64)
+
+#define __pread64(fd, buf, count, offset) \
+     static internal_function __emulate_pread64 (fd, buf, count, offset)
+#include <sysdeps/posix/pread64.c>
diff --git a/sysdeps/unix/sysv/linux/pwrite.c b/sysdeps/unix/sysv/linux/pwrite.c
new file mode 100644
index 0000000000..d8695db2a8
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/pwrite.c
@@ -0,0 +1,28 @@
+/* Copyright (C) 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+   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 <unistd.h>
+
+ssize_t
+__pwrite (int fd, const void *buf, size_t nbytes, off_t offset)
+{
+  return __pwrite64 (fd, buf, nbytes, (off64_t) offset);
+}
+
+weak_alias (__pwrite, pwrite)
diff --git a/sysdeps/unix/sysv/linux/pwrite64.c b/sysdeps/unix/sysv/linux/pwrite64.c
new file mode 100644
index 0000000000..f2b4bcbe4e
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/pwrite64.c
@@ -0,0 +1,53 @@
+/* Copyright (C) 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+   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 <unistd.h>
+
+extern ssize_t __syscall_pwrite64 (int fd, const void *buf, size_t count,
+				   off_t offset_hi, off_t offset_lo);
+
+static ssize_t __emulate_pwrite64 (int fd, const void *buf, size_t count,
+				   off64_t offset) internal_function;
+
+
+ssize_t
+__pwrite64 (fd, buf, count, offset)
+     int fd;
+     const void *buf;
+     size_t count;
+     off64_t offset;
+{
+  ssize_t result;
+
+  /* First try the syscall.  */
+  result = __syscall_pwrite64 (fd, buf, count, (off_t) (offset >> 32),
+			       (off_t) (offset & 0xffffffff));
+  if (result == -1 && errno == ENOSYS)
+    /* No system call available.  Use the emulation.  */
+    result = __emulate_pwrite64 (fd, buf, count, offset);
+
+  return result;
+}
+
+weak_alias (__pwrite64, pwrite64)
+
+#define __pwrite64(fd, buf, count, offset) \
+     static internal_function __emulate_pwrite64 (fd, buf, count, offset)
+#include <sysdeps/posix/pwrite64.c>
diff --git a/sysdeps/unix/sysv/linux/s_pread64.c b/sysdeps/unix/sysv/linux/s_pread64.c
new file mode 100644
index 0000000000..9c25a05e18
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/s_pread64.c
@@ -0,0 +1,30 @@
+/* Copyright (C) 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+   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 <unistd.h>
+
+/* This file is used if no system call is available.  */
+ssize_t
+__syscall_pread64 (int fd, char *buf, size_t count,
+		   off_t offset_hi, off_t offset_lo)
+{
+  __set_errno (ENOSYS);
+  return -1;
+}
diff --git a/sysdeps/unix/sysv/linux/s_pwrite64.c b/sysdeps/unix/sysv/linux/s_pwrite64.c
new file mode 100644
index 0000000000..bed11fd8ee
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/s_pwrite64.c
@@ -0,0 +1,30 @@
+/* Copyright (C) 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+   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 <unistd.h>
+
+/* This file is used if no system call is available.  */
+ssize_t
+__syscall_pwrite64 (int fd, const char *buf, size_t count,
+		    off_t offset_hi, off_t offset_lo)
+{
+  __set_errno (ENOSYS);
+  return -1;
+}
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/init-first.h b/sysdeps/unix/sysv/linux/sparc/sparc32/init-first.h
index 9bbe6bcdab..384c5c219b 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/init-first.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/init-first.h
@@ -76,12 +76,12 @@
 	cmp	%g2, 0
 	beq	3f
 	 sethi	%hi(__libc_multiple_libcs), %g3
-	ld	[%g4+%g2], %g2
+	ld	[%g2], %g2
 	subcc	%g0, %g2, %g0
 	subx	%g0, -1, %g2
 3:	or	%g3, %lo(__libc_multiple_libcs), %g3
 	cmp	%g2, 0
-	st	%g2, [%g3+%g4]
+	st	%g2, [%g3]
 	/* If so, argc et al are in %o0-%o2 already.  Otherwise, load them.  */
 	bnz	" #INIT "
 	 nop
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/socket.S b/sysdeps/unix/sysv/linux/sparc/sparc32/socket.S
index bdfc2fcc6d..4c65ac7f3c 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/socket.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/socket.S
@@ -23,6 +23,13 @@
 #define P(a, b) P2(a, b)
 #define P2(a, b) a##b
 
+#ifndef NARGS
+#ifdef socket
+#error NARGS not defined
+#endif
+#define NARGS 3
+#endif
+
 	.text
 /* The socket-oriented system calls are handled unusually in Linux.
    They are all gated through the single `socketcall' system call number.
@@ -34,25 +41,36 @@
 
 .globl P(__,socket)
 ENTRY (P(__,socket))
-	mov SYS_ify(socketcall), %g1    /* System call number */
 
-	/* Use ## so `socket' is a separate token that might be #define'd.  */
-	mov P(SOCKOP_,socket), %o0	/* Subcode is first arg to syscall.  */
-	mov %i0,%o1		        /* args pointer is second arg to syscall */
+	/* Drop up to 6 arguments (recvfrom) into the memory allocated by
+	   the caller for varargs, since that's really what we have.  */
+	st %o0, [%sp + 68 + 0]
+	st %o1, [%sp + 68 + 4]
+#if NARGS > 2
+	st %o2, [%sp + 68 + 8]
+#if NARGS > 3
+	st %o3, [%sp + 68 + 12]
+#if NARGS > 4
+	st %o4, [%sp + 68 + 16]
+#if NARGS > 5
+	st %o5, [%sp + 68 + 20]
+#endif
+#endif
+#endif
+#endif
 
+	mov P(SOCKOP_,socket), %o0	/* arg 1: socket subfunction */
+	add %sp, 68, %o1		/* arg 2: parameter block */
+	LOADSYSCALL(socketcall)
 	t 0x10
-	bcc,a	1
-	nop
-	save %sp,96,%sp
-	call __errno_location
-	nop
-	st %i0,[%o0]
-	restore
+
+        bcs,a 1f
+	 nop
 	retl
-	mov -1,%o0
-1:
-	ret
+	 nop
+
+1:	SYSCALL_ERROR_HANDLER
 
-PSEUDO_END (P(__,socket))
+END (P(__,socket))
 
 weak_alias (P(__,socket), socket)
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/pread64.c b/sysdeps/unix/sysv/linux/sparc/sparc64/pread64.c
new file mode 100644
index 0000000000..b7f298dea8
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/pread64.c
@@ -0,0 +1 @@
+/* Empty since the pread syscall is equivalent.  */
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/pwrite64.c b/sysdeps/unix/sysv/linux/sparc/sparc64/pwrite64.c
new file mode 100644
index 0000000000..b7f298dea8
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/pwrite64.c
@@ -0,0 +1 @@
+/* Empty since the pread syscall is equivalent.  */
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list b/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list
index e5425e9a29..d0bee8fa07 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list
@@ -2,6 +2,8 @@
 
 # Whee! 64-bit systems naturally implement llseek.
 llseek		EXTRA	lseek		3	llseek
+pread		EXTRA	pread		4	__pread		pread __pread64 pread64
+pwrite		EXTRA	pwrite		4	__pwrite	pwrite __pwrite64 pwrite64
 
 # Override select.S in parent directory:
 select		-	select		5	__select	select
diff --git a/sysdeps/unix/sysv/linux/sys/prctl.h b/sysdeps/unix/sysv/linux/sys/prctl.h
new file mode 100644
index 0000000000..b5b4412fc4
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sys/prctl.h
@@ -0,0 +1,32 @@
+/* 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 _SYS_PRCTL_H
+#define _SYS_PRCTL_H	1
+
+#include <features.h>
+#include <linux/prctl.h>  /*  The magic values come from here  */
+
+__BEGIN_DECLS
+
+/* Control process execution.  */
+extern int prctl __P ((int __option, ...));
+
+__END_DECLS
+
+#endif  /* sys/prctl.h */
diff --git a/sysdeps/unix/sysv/linux/syscalls.list b/sysdeps/unix/sysv/linux/syscalls.list
index 6028a04aaf..a1fe445739 100644
--- a/sysdeps/unix/sysv/linux/syscalls.list
+++ b/sysdeps/unix/sysv/linux/syscalls.list
@@ -38,7 +38,9 @@ quotactl	EXTRA	quotactl	4	quotactl
 s_getdents	EXTRA	getdents	3	__getdents
 s_getpriority	getpriority getpriority	2	__syscall_getpriority
 s_poll		poll	poll		3	__syscall_poll
+s_pread64	EXTRA	pread		5	__syscall_pread64
 s_ptrace	ptrace	ptrace		4	__syscall_ptrace
+s_pwrite64	EXTRA	pwrite		5	__syscall_pwrite64
 s_reboot	EXTRA	reboot		3	__syscall_reboot
 s_sigaction	sigaction sigaction	3	__syscall_sigaction
 s_sigsuspend	sigsuspend sigsuspend	3	__syscall_sigsuspend
diff --git a/termios/Makefile b/termios/Makefile
index b637633e52..7d13928f88 100644
--- a/termios/Makefile
+++ b/termios/Makefile
@@ -25,6 +25,6 @@ headers	:= termios.h bits/termios.h sys/ttydefaults.h sys/termios.h \
 	   sys/ttychars.h
 
 routines	:= speed cfsetspeed tcsetattr tcgetattr tcgetpgrp tcsetpgrp \
-		   tcdrain tcflow tcflush tcsendbrk cfmakeraw
+		   tcdrain tcflow tcflush tcsendbrk cfmakeraw tcgetsid
 
 include ../Rules
diff --git a/termios/tcgetsid.c b/termios/tcgetsid.c
new file mode 100644
index 0000000000..b83858f420
--- /dev/null
+++ b/termios/tcgetsid.c
@@ -0,0 +1,64 @@
+/* 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 <termios.h>
+#include <sys/ioctl.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+/* Return the session ID of FD.  */
+pid_t
+tcgetsid (fd)
+     int fd;
+{
+  pid_t pgrp;
+  pid_t sid;
+#ifdef TIOCGSID
+  static int tiocgsid_works = 1;
+
+  if (tiocgsid_works)
+    {
+      int serrno = errno;
+      int sid;
+
+      if (__ioctl (fd, TIOCGSID, &sid) < 0)
+	{
+	  if (errno == EINVAL)
+	    {
+	      tiocgsid_works = 0;
+	      __set_errno (serrno);
+	    }
+	  else
+	    return (pid_t) -1;
+	}
+      else
+	return (pid_t) sid;
+    }
+#endif
+
+  pgrp = tcgetpgrp (fd);
+  if (pgrp == -1)
+    return (pid_t) -1;
+
+  sid = getsid (pgrp);
+  if (sid == -1 && errno == ESRCH)
+    __set_errno (ENOTTY);
+
+  return sid;
+}
diff --git a/termios/termios.h b/termios/termios.h
index 3c8d16eed8..0b06f09587 100644
--- a/termios/termios.h
+++ b/termios/termios.h
@@ -24,6 +24,14 @@
 #define	_TERMIOS_H	1
 
 #include <features.h>
+#ifdef __USE_UNIX98
+/* We need `pid_t'.  */
+# include <bits/types.h>
+# ifndef pid_t
+typedef __pid_t pid_t;
+#  define pid_t pid_t
+# endif
+#endif
 
 __BEGIN_DECLS
 
@@ -85,6 +93,12 @@ extern int tcflush __P ((int __fd, int __queue_selector));
 extern int tcflow __P ((int __fd, int __action));
 
 
+#ifdef __USE_UNIX98
+/* Get process group ID for session leader for controlling terminal FD.  */
+extern __pid_t tcgetsid __P ((int __fd));
+#endif
+
+
 #ifdef __USE_BSD
 # include <sys/ttydefaults.h>
 #endif