about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog128
-rw-r--r--Make-dist3
-rw-r--r--Makeconfig14
-rw-r--r--Makefile13
-rw-r--r--Makerules78
-rw-r--r--config.make.in3
-rw-r--r--elf/Makefile12
-rw-r--r--gnu-versions.h4
-rw-r--r--hurd/Makefile5
-rw-r--r--intl/Makefile2
-rw-r--r--malloc/obstack.h17
-rw-r--r--manual/Makefile6
-rw-r--r--misc/regexp.h6
-rw-r--r--po/Makefile2
-rw-r--r--posix/getopt.c2
-rw-r--r--posix/getopt1.c2
-rw-r--r--stdio-common/Makefile3
-rw-r--r--stdio-common/bug10.c2
-rw-r--r--stdio-common/scanf1.c2
-rw-r--r--stdio-common/scanf10.c2
-rw-r--r--stdio-common/scanf3.c4
-rw-r--r--stdio-common/tstdiomisc.c2
-rw-r--r--stdio-common/vfscanf.c28
-rw-r--r--sunrpc/Makefile9
-rw-r--r--sysdeps/mach/hurd/Makefile8
-rwxr-xr-xsysdeps/mach/hurd/configure3
-rw-r--r--sysdeps/mach/hurd/configure.in3
-rw-r--r--sysdeps/mach/hurd/getdents.c38
-rw-r--r--sysdeps/mach/hurd/vdprintf.c30
-rw-r--r--sysdeps/posix/pipestream.c34
-rw-r--r--sysdeps/standalone/i386/force_cpu386/Makefile4
-rw-r--r--sysdeps/stub/getdents.c34
-rw-r--r--sysdeps/unix/bsd/sony/newsos4/Makefile2
-rw-r--r--sysdeps/unix/bsd/sun/sunos4/Makefile4
-rw-r--r--sysdeps/unix/getdents.c4
-rw-r--r--sysdeps/unix/readdir.c34
-rw-r--r--sysdeps/unix/sysv/Makefile2
-rw-r--r--sysdeps/unix/sysv/getdents.c4
-rw-r--r--sysdeps/unix/sysv/linux/Dist2
-rw-r--r--sysdeps/unix/sysv/linux/Makefile18
-rw-r--r--sysdeps/unix/sysv/linux/alpha/Dist2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/Makefile2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/ioctls.h39
-rw-r--r--sysdeps/unix/sysv/linux/alpha/ioperm.c194
-rw-r--r--sysdeps/unix/sysv/linux/alpha/sys/kernel_termios.h (renamed from sysdeps/unix/sysv/linux/alpha/kernel_termios.h)6
-rw-r--r--sysdeps/unix/sysv/linux/alpha/sys/procfs.h2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/syscalls.list1
-rw-r--r--sysdeps/unix/sysv/linux/configure2
-rw-r--r--sysdeps/unix/sysv/linux/getdents.c26
-rw-r--r--sysdeps/unix/sysv/linux/i386/Makefile2
-rw-r--r--sysdeps/unix/sysv/linux/sys/kernel_termios.h (renamed from sysdeps/unix/sysv/linux/kernel_termios.h)6
-rw-r--r--sysdeps/unix/sysv/linux/sys/procfs.h2
-rw-r--r--sysdeps/unix/sysv/linux/tcgetattr.c6
-rw-r--r--sysdeps/unix/sysv/linux/tcsetattr.c6
-rw-r--r--time/Banner1
-rw-r--r--time/Makefile35
-rw-r--r--time/README28
-rw-r--r--time/strftime.c27
58 files changed, 632 insertions, 328 deletions
diff --git a/ChangeLog b/ChangeLog
index be142d580a..338352f251 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,131 @@
+Thu Jan 23 04:06:42 1997  Ulrich Drepper  <drepper@cygnus.com>
+
+	* Make-dist (.PHONY: dist): Remove duplicate declaration.
+	(README): Depend on version.h not version.c.
+	* Makefile (README): Depend on version.h not version.c.
+
+	* Makeconfig (inst_libdir, inst_slibdir, inst_includedir,
+	inst_datadir, inst_zonedir, inst_localedir, inst_i18ndir, inst_bindir,
+	inst_sbindir, inst_infodir, inst_sysconfdir): New variables.  Same
+	as variable withough inst_ but prepended with $(install_root).
+	(localtime-time): Use $(inst_sysconfdir) not $(sysconfdir).
+	* Makefile (install-others): Use $(inst_includedir).
+	(gnu/stabs.h, gnu/lib-names.h): Use $(inst_includedir).
+	* Makerules (tons of install rules): Use inst_% variables.
+	* elf/Makefile: Likewise.
+	* hurd/Makefile: Likewise.
+	* intl/Makefile: Likewise.
+	* manual/Makefile: Likewise.
+	* po/Makefile: Likewise.
+	* sunrpc/Makefile: Likewise.
+	* sysdeps/mach/hurd/Makefile: Likewise.
+	* sysdeps/standalone/i386/force_cpu386/Makefile: Likewise.
+	* time/Makefile: Likewise.
+
+	* config.make.in: Revert patch from Sat Jan 18 22:15:26 1997,
+	leave install_root in place.
+
+	* gnu-versions.h (_GNU_GETOPT_INTERFACE_VERSION): Define to 2.
+	* posix/getopt.c (GETOPT_INTERFACE_VERSION): Define to 2.
+	* posix/getopt1.c (GETOPT_INTERFACE_VERSION): Define to 2.
+
+	* elf/Makefile [yes==$(has-ldconfig)]: Correct dependencies of
+	ldconfig.
+	(CFLAGS-dl-load.c): New variable, avoid gcc warning.
+
+	* sysdeps/mach/hurd/configure.in: Add _LIBC_REENTRENT to DEFINES.
+
+	* sysdeps/mach/hurd/getdents.c: Update copyright.  De-ANSI-declfy.
+	* sysdeps/stub/getdents.c: Likewise.  Correct return value.
+	* sysdeps/unix/getdents.c: Likewise.
+	* sysdeps/unix/sysv/getdents.c: Likewise.
+
+	* sysdeps/unix/readdir.c: Update copyright.
+
+	* sysdeps/unix/bsd/sony/newsos4/Makefile: Correct ifeq arguments.
+	* sysdeps/unix/bsd/sun/sunos4/Makefile: Likewise.
+	* sysdeps/unix/sysv/Makefile: Likewise.
+	* sysdeps/unix/sysv/linux/Makefile: Likewise.
+	* sysdeps/unix/sysv/linux/alpha/Makefile: Likewise.
+	* sysdeps/unix/sysv/linux/i386/Makefile: Likewise.
+
+	* sysdeps/unix/sysv/linux/Dist: Don't distribute kernel_termios.h,
+	but sys/kernel_termios.h.
+	* sysdeps/unix/sysv/linux/alpha/Dist: Likewise.
+	* sysdeps/unix/sysv/linux/Makefile [$(subdir)==termios]
+	(sysdep_headers): Add sys/kernel_termios.h.
+	* sysdeps/unix/sysv/linux/kernel_termios.h: Moved to...
+	* sysdeps/unix/sysv/linux/sys/kernel_termios.h: ...here.
+	* sysdeps/unix/sysv/linux/sys/tcgetattr.c: Use __kernel_termios and
+	__KERNEL_NCCS instead of kernel_termios and KERNEL_NCCS resp.
+
+	* sysdeps/unix/sysv/linux/alpha/ioctls.h: New file.
+
+	* sysdeps/unix/sysv/linux/getdents.c: Correct problems with alignment.
+	* sysdeps/unix/sysv/linux/alpha/syscalls.list: Remove getdents.
+	Reported by Eirik Fuller <eirik@netcom.com>.
+
+	* time/Banner: Removed.  Wrong and unnecessary information.  It's now
+	in...
+	* time/README: New file.
+	* time/Makefile (distribute): Remove Banner, add README.
+
+Wed Jan 22 13:19:56 1997  Richard Henderson  <rth@tamu.edu>
+
+	* sysdeps/unix/sysv/linux/alpha/ioperm.c (platforms): Add Sable.
+	(init_iosys): Recognize /etc/alpha_systype as a four-tuple for
+	the purpose of supporting brand new systems.
+	(*): The type of iosys variables should be iosys_t.
+
+1997-01-22  Paul Eggert  <eggert@twinsun.com>
+
+	* strftime.c (_strftime_copytm):
+	New function, to work around Solaris 2.5 tzset bug.
+
+Wed Jan 22 23:05:14 1997  Ulrich Drepper  <drepper@cygnus.com>
+
+	* sysdeps/mach/hurd/vdprintf.c: Complete de-ANSI-declfication.
+	* sysdeps/posix/pipestream.c (writedecl): Fix typo.
+	Reported by Marcus G. Daniels <marcus@shannon.sysc.pdx.edu>.
+
+Wed Jan 22 13:58:56 1997  Andreas Jaeger  <aj@arthur.pfalz.de>
+
+	* elf/Makefile (CFLAGS-dl-load.c): New Variable to keep gcc silent
+	since name_copy is initialized.
+
+Wed Jan 22 16:58:12 1997  Ulrich Drepper  <drepper@cygnus.com>
+
+	* stdio-common/Makefile (tests): Remove scanf11.
+	* stdio-common/scanf11.c: Removed.
+	* stdio-common/vfscanf.c Revert patch of Thu Jan 16 23:39:25 1997.
+	Although the Corrigendum 1 describes the result as implemented the
+	even more recent Amendement 1 seconds the position of ISO C:1990
+	where the %n directive has no effect on the assignment count.
+	* stdio-common/bug10.c: Likewise.
+	* stdio-common/scanf1.c: Likewise.
+	* stdio-common/scanf3.c: Likewise.
+	* stdio-common/scanf10.c: Likewise.
+	* stdio-common/tstdiomisc.c: Likewise.
+
+	* new-malloc/obstack.h: Don't define malloc using bcopy if malloc
+	is not available.  This leads to problems since bcopy does not
+	return a value.  Instead define _obstack_memcpy based on memcpy or
+	bcopy.  This name isn't used outside obstack.h and so no problems
+	from using the memcpy function in a file including obstack.h can
+	result.
+	Reported by Martin Trapp <trapp@ipd.info.uni-karlsruhe.de>.
+
+Tue Jan 21 18:35:55 1997  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
+
+	* misc/regexp.h (compile): Fix typos.
+
+Tue Jan 21 01:01:59 1997  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
+
+	* sysdeps/unix/sysv/linux/sys/procfs.h (struct elf_prpsinfo): Fix
+	type of pr_{pid,ppid,pgrp,sid} fields.
+	* sysdeps/unix/sysv/linux/alpha/sys/procfs.h (struct
+	elf_prpsinfo): Likewise.
+
 1997-01-21  Paul Eggert  <eggert@twinsun.com>
 
 	* posix/getopt.c (_getopt_internal): Return -1, not EOF, when args
diff --git a/Make-dist b/Make-dist
index 301eb6eda7..84252d46ab 100644
--- a/Make-dist
+++ b/Make-dist
@@ -190,7 +190,6 @@ endef
 configure: configure.in aclocal.m4; $(autoconf-it)
 %/configure: %/configure.in aclocal.m4; $(autoconf-it)
 
-.PHONY: dist
 dist: $(tardir).tar.gz
 
 subdir_dist: dist.tar
@@ -217,7 +216,7 @@ $(dist-subdirs):
 	$(MAKE) -C $(patsubst dist-%,%,$@) dist
 
 # This is here instead of in Makefile so it can use $(release) and $(version).
-README: README.template version.c
+README: README.template version.h
 	-rm -f $@
 	sed -e 's/RELEASE/$(release)/' -e 's/VERSION/$(version)/' < $< > $@
 # Make it unwritable so I won't change it by mistake.
diff --git a/Makeconfig b/Makeconfig
index 46d9b72e79..dd6d6297b2 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -146,11 +146,13 @@ endif
 ifndef libdir
 libdir = $(exec_prefix)/lib
 endif
+inst_libdir = $(install_root)$(libdir)
 
 # Where to install the shared library and dynamic linker.
 ifndef slibdir
 slibdir = $(exec_prefix)/lib
 endif
+inst_slibdir = $(install_root)$(slibdir)
 
 # Prefix to put on files installed in $(libdir).  For libraries `libNAME.a',
 # the prefix is spliced between `lib' and the name, so the linker switch
@@ -164,54 +166,64 @@ endif
 ifndef includedir
 includedir = $(exec_prefix)/include
 endif
+inst_includedir = $(install_root)$(includedir)
 
 # Where to install machine-independent data files.
 # These are the timezone database, and the locale database.
 ifndef datadir
 datadir = $(prefix)/share
 endif
+inst_datadir = $(install_root)$(datadir)
 
 # Where to install the timezone data files (which are machine-independent).
 ifndef zonedir
 zonedir = $(datadir)/zoneinfo
 endif
+inst_zonedir = $(install_root)$(zonedir)
 
 # Where to install the locale and message catalog data files (which are
 # machine-independent).
 ifndef localedir
 localedir = $(datadir)/locale
 endif
+inst_localedir = $(install_root)$(localedir)
 
 # Where to install the locale charmap source files.
 ifndef i18ndir
 i18ndir = $(datadir)/i18n
 endif
+inst_i18ndir = $(install_root)$(i18ndir)
 
 
 # Where to install programs.
 ifndef bindir
 bindir = $(exec_prefix)/bin
 endif
+inst_bindir = $(install_root)$(bindir)
 
 # Where to install administrative programs.
 ifndef rootsbindir
 rootsbindir = $(exec_prefix)/sbin
 endif
+inst_rootsbindir = $(install_root)$(rootsbindir)
 
 ifndef sbindir
 sbindir = $(exec_prefix)/sbin
 endif
+inst_sbindir = $(install_root)$(sbindir)
 
 # Where to install the Info files.
 ifndef infodir
 infodir = $(prefix)/info
 endif
+inst_infodir = $(install_root)$(infodir)
 
 # Where to install default configuration files.  These include the local
 # timezone specification and network data base files.
 ifndef sysconfdir
 sysconfdir = $(prefix)/etc
 endif
+inst_sysconfdir = $(install_root)$(sysconfdir)
 
 # What timezone should be the installed default (e.g., US/Eastern).
 # Run `make -C time echo-zonenames' to see a list of available zone names.
@@ -226,7 +238,7 @@ endif
 # other than there, so the zoneinfo directory contains only universal data,
 # localizing the configuration data elsewhere.
 ifndef localtime-file
-localtime-file = $(sysconfdir)/localtime
+localtime-file = $(inst_sysconfdir)/localtime
 endif
 
 # What to use for leap second specifications in compiling the default
diff --git a/Makefile b/Makefile
index 0d47b07c14..38559c26d5 100644
--- a/Makefile
+++ b/Makefile
@@ -90,9 +90,9 @@ before-compile = $(objpfx)version-info.h
 echo-headers: subdir_echo-headers
 
 # What to install.
-install-others = $(includedir)/gnu/stubs.h
+install-others = $(inst_includedir)/gnu/stubs.h
 ifeq (yes,$(build-shared))
-install-others += $(includedir)/gnu/lib-names.h
+install-others += $(inst_includedir)/gnu/lib-names.h
 endif
 install-bin = glibcbug
 
@@ -111,8 +111,11 @@ include Makerules
 
 # Install from subdirectories too.
 install: subdir_install
+
+# Create linkfs for shared libraries using the `ldconfig' program is possible.
 ifeq (no,$(cross-compiling))
 ifeq (yes,$(build-shared))
+install:
 	test ! -x $(common-objpfx)elf/ldconfig || \
 	  $(common-objpfx)elf/ldconfig -d
 endif
@@ -175,7 +178,7 @@ subdir-stubs := $(foreach dir,$(subdirs),$(common-objpfx)stub-$(dir))
 # iterates over all the subdirs; subdir_install in each subdir depends on
 # the subdir's stubs file.  Having more direct dependencies would result in
 # extra iterations over the list for subdirs and many recursive makes.
-$(includedir)/gnu/stubs.h: subdir_install
+$(inst_includedir)/gnu/stubs.h: subdir_install
 	@rm -f $(objpfx)stubs.h
 	(echo '/* This file is automatically generated.';\
 	 echo '   It defines a symbol `__stub_FUNCTION'\'' for each function';\
@@ -191,7 +194,7 @@ ifeq (yes,$(build-shared))
 
 # Like gnu/stubs.h the gnu/lib-names.h header is not used while building the
 # libc itself.  So we generate it while installing.
-$(includedir)/gnu/lib-names.h: $(common-objpfx)soversions.mk
+$(inst_includedir)/gnu/lib-names.h: $(common-objpfx)soversions.mk
 	@rm -f $(objpfx)lib-names.h
 	(echo '/* This file is automatically generated.';\
 	 echo '   It defines macros to allow user program to find the shared';\
@@ -307,7 +310,7 @@ distribute  := README INSTALL FAQ NOTES NEWS PROJECTS			\
 distribute := $(strip $(distribute))
 generated := $(generated) stubs.h version-info.h
 
-README: README.template version.c ; # Make-dist should update README.
+README: README.template version.h ; # Make-dist should update README.
 
 define format-me
 @rm -f $@
diff --git a/Makerules b/Makerules
index 08de5a17f9..95e1cbcb0f 100644
--- a/Makerules
+++ b/Makerules
@@ -569,11 +569,11 @@ endef
 # to install everything it changes.
 ifdef objects
 installed-libcs := $(foreach o,$(object-suffixes),\
-			     $(libdir)/$(patsubst %,$(libtype$o),\
-						  $(libprefix)$(libc-name)))
+			     $(inst_libdir)/$(patsubst %,$(libtype$o),\
+						     $(libprefix)$(libc-name)))
 installed-libcs := $(filter-out %_pic.a,$(installed-libcs))
 install: $(installed-libcs)
-$(installed-libcs): $(libdir)/lib$(libprefix)%: lib
+$(installed-libcs): $(inst_libdir)/lib$(libprefix)%: lib
 	$(make-target-directory)
 	$(INSTALL_DATA) $(common-objpfx)lib$(*:$(libc-name)%=c%) $@
 # Running ranlib after installing makes the __.SYMDEF time stamp up to
@@ -591,15 +591,15 @@ install-lib.so := $(filter %.so,$(install-lib:%_pic.a=%.so))
 install-lib := $(filter-out %.so %_pic.a,$(install-lib))
 ifeq (yes,$(build-shared))
 
-install-lib-nosubdir: $(install-lib.so:%=$(libdir)/%)
+install-lib-nosubdir: $(install-lib.so:%=$(inst_libdir)/%)
 
 # Find which .so's have versions.
 versioned := $(strip $(foreach so,$(install-lib.so),\
 			       $(patsubst %,$(so),$($(so)-version))))
 
 # Install all the unversioned shared libraries.
-$(addprefix $(slibdir)/,$(filter-out $(versioned),$(install-lib.so))): \
-$(slibdir)/%.so: $(objpfx)%.so; $(do-install-program)
+$(addprefix $(inst_slibdir)/, $(filter-out $(versioned),$(install-lib.so))): \
+	$(inst_slibdir)/%.so: $(objpfx)%.so; $(do-install-program)
 
 ifneq ($(findstring -s,$(LN_S)),)
 define make-link
@@ -635,20 +635,21 @@ ifdef libc.so-version
 # libc.so	->	libc.so.N	(e.g. libc.so.6)
 # libc.so.6	->	libc-VERSION.so	(e.g. libc-1.10.so)
 
-$(slibdir)/libc.so$(libc.so-version): $(slibdir)/libc-$(version).so
+$(inst_slibdir)/libc.so$(libc.so-version): $(inst_slibdir)/libc-$(version).so
 	$(make-shlib-link)
-$(slibdir)/libc-$(version).so: $(common-objpfx)libc.so; $(do-install-program)
-install: $(slibdir)/libc.so$(libc.so-version)
+$(inst_slibdir)/libc-$(version).so: $(common-objpfx)libc.so
+	$(do-install-program)
+install: $(inst_slibdir)/libc.so$(libc.so-version)
 
 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.
-install: $(libdir)/libc.so
-$(libdir)/libc.so: $(common-objpfx)libc.so$(libc.so-version) \
-		   $(elfobjdir)/$(rtld-installed-name) \
-		   $(libdir)/lib$(libc-name).a
+install: $(inst_libdir)/libc.so
+$(inst_libdir)/libc.so: $(common-objpfx)libc.so$(libc.so-version) \
+			$(elfobjdir)/$(rtld-installed-name) \
+			$(inst_libdir)/lib$(libc-name).a
 	(echo '/* GNU ld script';\
 	 echo '   Use the shared library, but some functions are only in';\
 	 echo '   the static library, so try that secondarily.'; \
@@ -661,8 +662,9 @@ $(libdir)/libc.so: $(common-objpfx)libc.so$(libc.so-version) \
 endif
 
 else
-install: $(slibdir)/libc.so
-$(slibdir)/libc.so: $(common-objpfx)libc.so; $(do-install-program)
+install: $(inst_slibdir)/libc.so
+$(inst_slibdir)/libc.so: $(common-objpfx)libc.so
+	$(do-install-program)
 endif
 
 
@@ -670,7 +672,7 @@ ifneq (,$(versioned))
 # Produce three sets of rules as above for all the smaller versioned libraries.
 
 define o-iterator-doit
-$(libdir)/$o: $(slibdir)/$o$($o-version); $$(make-link)
+$(inst_libdir)/$o: $(inst_slibdir)/$o$($o-version); $$(make-link)
 endef
 object-suffixes-left := $(versioned)
 include $(o-iterator)
@@ -686,27 +688,28 @@ include $(o-iterator)
 
 ifeq (,$($(subdir)-version))
 define o-iterator-doit
-$(slibdir)/$o$($o-version): $(slibdir)/$(o:.so=)-$(version).so;
+$(inst_slibdir)/$o$($o-version): $(inst_slibdir)/$(o:.so=)-$(version).so;
 	$$(make-shlib-link)
 endef
 object-suffixes-left := $(versioned)
 include $(o-iterator)
 
 define o-iterator-doit
-$(slibdir)/$(o:.so=)-$(version).so: $(objpfx)$o; $$(do-install-program)
+$(inst_slibdir)/$(o:.so=)-$(version).so: $(objpfx)$o; $$(do-install-program)
 endef
 object-suffixes-left := $(versioned)
 include $(o-iterator)
 else
 define o-iterator-doit
-$(slibdir)/$o$($o-version): $(slibdir)/$(o:.so=)-$($(subdir)-version).so;
+$(inst_slibdir)/$o$($o-version): \
+  $(inst_slibdir)/$(o:.so=)-$($(subdir)-version).so;
 	$$(make-shlib-link)
 endef
 object-suffixes-left := $(versioned)
 include $(o-iterator)
 
 define o-iterator-doit
-$(slibdir)/$(o:.so=)-$($(subdir)-version).so: $(objpfx)$o;
+$(inst_slibdir)/$(o:.so=)-$($(subdir)-version).so: $(objpfx)$o;
 	$$(do-install-program)
 endef
 object-suffixes-left := $(versioned)
@@ -722,23 +725,24 @@ endef
 
 so-versions := $(sort $(foreach so,$(install-lib.so),.so$($(so)-version)))
 $(foreach v,$(so-versions),\
-	  $(slibdir)/lib$(libprefix)%$v): $(common-objpfx)lib%.so
+	  $(inst_slibdir)/lib$(libprefix)%$v): $(common-objpfx)lib%.so
 	$(do-install-so)
 $(foreach v,$(so-versions),\
-	  $(slibdir)/$(libprefix)%$v): $(common-objpfx)%.so
+	  $(inst_slibdir)/$(libprefix)%$v): $(common-objpfx)%.so
 	$(do-install-so)
 endif
 
 ifdef install-bin
-$(addprefix $(bindir)/,$(install-bin)): $(bindir)/%: $(objpfx)%
+$(addprefix $(inst_bindir)/,$(install-bin)): $(inst_bindir)/%: $(objpfx)%
 	$(do-install-program)
 endif
 ifdef install-rootsbin
-$(addprefix $(rootsbindir)/,$(install-rootsbin)): $(rootsbindir)/%: $(objpfx)%
+$(addprefix $(inst_rootsbindir)/,$(install-rootsbin)):
+   $(inst_rootsbindir)/%: $(objpfx)%
 	$(do-install-program)
 endif
 ifdef install-sbin
-$(addprefix $(sbindir)/,$(install-sbin)): $(sbindir)/%: $(objpfx)%
+$(addprefix $(inst_sbindir)/,$(install-sbin)): $(inst_sbindir)/%: $(objpfx)%
 	$(do-install-program)
 endif
 ifdef install-lib
@@ -750,31 +754,33 @@ $(addprefix $(libdir)/$(libprefix),$(install-lib-non.a)): \
 	$(do-install)
 endif
 ifdef install-lib.a
-$(install-lib.a:lib%.a=$(libdir)/lib$(libprefix)%.a): \
-  $(libdir)/lib$(libprefix)%.a: $(objpfx)lib%.a
+$(install-lib.a:lib%.a=$(inst_libdir)/lib$(libprefix)%.a): \
+  $(inst_libdir)/lib$(libprefix)%.a: $(objpfx)lib%.a
 	$(do-install)
 	$(patsubst %,$(RANLIB) $@,$(filter-out $(non-lib.a),$(<F)))
 endif
 endif
 ifdef install-data
-$(addprefix $(datadir)/,$(install-data)): $(datadir)/%: %;$(do-install)
+$(addprefix $(inst_datadir)/,$(install-data)): $(inst_datadir)/%: %;
+	$(do-install)
 endif
 headers := $(strip $(headers))
 ifdef headers
-$(addprefix $(includedir)/,$(headers)): \
-	$(includedir)/%: %;$(do-install)
+$(addprefix $(inst_includedir)/,$(headers)): $(inst_includedir)/%: %;
+	$(do-install)
 endif	# headers
 
 .PHONY: install-bin-nosubdir install-rootsbin-nosubdir install-sbin-nosubdir \
 	install-lib-nosubdir install-data-nosubdir install-headers-nosubdir
-install-bin-nosubdir: $(addprefix $(bindir)/,$(install-bin))
-install-rootsbin-nosubdir: $(addprefix $(rootsbindir)/,$(install-rootsbin))
-install-sbin-nosubdir: $(addprefix $(sbindir)/,$(install-sbin))
-install-lib-nosubdir: $(addprefix $(libdir)/,\
+install-bin-nosubdir: $(addprefix $(inst_bindir)/,$(install-bin))
+install-rootsbin-nosubdir: \
+	$(addprefix $(inst_rootsbindir)/,$(install-rootsbin))
+install-sbin-nosubdir: $(addprefix $(inst_sbindir)/,$(install-sbin))
+install-lib-nosubdir: $(addprefix $(inst_libdir)/,\
 		       $(patsubst lib%.a,lib$(libprefix)%.a,$(install-lib.a)) \
 		       $(addprefix $(libprefix),$(install-lib-non.a)))
-install-data-nosubdir: $(addprefix $(datadir)/,$(install-data))
-install-headers-nosubdir: $(addprefix $(includedir)/,$(headers))
+install-data-nosubdir: $(addprefix $(inst_datadir)/,$(install-data))
+install-headers-nosubdir: $(addprefix $(inst_includedir)/,$(headers))
 install-others-nosubdir: $(install-others)
 
 # We need all the `-nosubdir' targets so that `install' in the parent
diff --git a/config.make.in b/config.make.in
index 0e61a145f1..893dabe236 100644
--- a/config.make.in
+++ b/config.make.in
@@ -3,11 +3,12 @@
 # Don't edit this file.  Put configuration parameters in configparms instead.
 
 # Installation prefixes.
+install_root =
 prefix = @prefix@
 exec_prefix = @exec_prefix@
 slibdir = @libc_cv_slibdir@
 sysconfdir = @libc_cv_sysconfdir@
-rootsbindir = $(install_root)@libc_cv_rootsbindir@
+rootsbindir = @libc_cv_rootsbindir@
 
 # If ldconfig exists.  This will go away as soon as `ldconfig' is available
 # in GNU libc.
diff --git a/elf/Makefile b/elf/Makefile
index 63a63127f8..5426e4e309 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -51,15 +51,15 @@ include ../Makeconfig
 ifeq (yes,$(build-shared))
 extra-objs	= $(rtld-routines:=.so) soinit.so sofini.so eval.so
 generated	= librtld.so dl-allobjs.so
-install-others	= $(slibdir)/$(rtld-installed-name)
+install-others	= $(inst_slibdir)/$(rtld-installed-name)
 install-bin	= ldd
 endif
 
 ifeq (yes,$(has-ldconfig))
-others		= ldconfig
+extra-objs	= ldconfig.o
 install-rootsbin = ldconfig
 
-$(objpfx)ldconfig: ldconfig.o
+$(objpfx)ldconfig: $(objpfx)ldconfig.o
 	$(CC) -nostdlib -nostartfiles -o $@ $(sysdep-LDFLAGS) -static	      \
 	      $(addprefix $(csu-objpfx),start.o) $(+preinit)		      \
 	      $(filter-out $(addprefix $(csu-objpfx),start.o) $(+preinit)     \
@@ -118,15 +118,17 @@ $(objpfx)trusted-dirs.h: Makefile
 	 done;) > $@T
 	mv -f $@T $@
 CPPFLAGS-dl-load.c = -I$(objdir)/$(subdir)
+CFLAGS-dl-load.c = -Wno-uninitialized
 
 # Specify the dependencies of libdl.so; its commands come from the generic
 # rule to build a shared library.
 $(objpfx)libdl.so: $(objpfx)libdl_pic.a $(common-objpfx)libc.so $(objpfx)ld.so
 
-$(slibdir)/$(rtld-version-installed-name): $(objpfx)ld.so
+$(inst_slibdir)/$(rtld-version-installed-name): $(objpfx)ld.so
 	$(do-install-program)
 
-$(slibdir)/$(rtld-installed-name): $(slibdir)/$(rtld-version-installed-name)
+$(inst_slibdir)/$(rtld-installed-name): \
+  $(inst_slibdir)/$(rtld-version-installed-name)
 	$(make-shlib-link)
 
 ifneq ($(have-bash2),yes)
diff --git a/gnu-versions.h b/gnu-versions.h
index 68545bd9b6..f27e34fc29 100644
--- a/gnu-versions.h
+++ b/gnu-versions.h
@@ -1,5 +1,5 @@
 /* Header with interface version macros for library pieces copied elsewhere.
-   Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996, 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
@@ -47,7 +47,7 @@
 #define _GNU_OBSTACK_INTERFACE_VERSION	1 /* vs malloc/obstack.c */
 #define _GNU_REGEX_INTERFACE_VERSION	1 /* vs posix/regex.c */
 #define _GNU_GLOB_INTERFACE_VERSION	1 /* vs posix/glob.c */
-#define _GNU_GETOPT_INTERFACE_VERSION	1 /* vs posix/getopt.c and
+#define _GNU_GETOPT_INTERFACE_VERSION	2 /* vs posix/getopt.c and
 					     posix/getopt1.c */
 
 #endif	/* gnu-versions.h */
diff --git a/hurd/Makefile b/hurd/Makefile
index 7d0e9713b8..deafb1ec3d 100644
--- a/hurd/Makefile
+++ b/hurd/Makefile
@@ -74,9 +74,10 @@ include ../Rules
 # to get installed.
 sunrpc-headers = netdb.h pmap_prot.h xdr.h types.h auth.h \
 	rpc_msg.h auth_unix.h
-installed-sunrpc-headers = $(addprefix $(includedir)/rpc/,$(sunrpc-headers))
+installed-sunrpc-headers = $(addprefix $(inst_includedir)/rpc/, \
+				       $(sunrpc-headers))
 install-headers-nosubdir: $(installed-sunrpc-headers)
-$(installed-sunrpc-headers): $(includedir)/%: $(..)sunrpc/%
+$(installed-sunrpc-headers): $(inst_includedir)/%: $(..)sunrpc/%
 	$(do-install)
 
 
diff --git a/intl/Makefile b/intl/Makefile
index 356a40ca7f..db4db7c16c 100644
--- a/intl/Makefile
+++ b/intl/Makefile
@@ -25,7 +25,7 @@ routines = bindtextdom dcgettext dgettext gettext	\
 	   l10nflist explodename
 distribute = gettext.h gettextP.h hash-string.h loadinfo.h locale.alias
 
-install-others = $(localedir)/locale.alias
+install-others = $(inst_localedir)/locale.alias
 
 include ../Rules
 
diff --git a/malloc/obstack.h b/malloc/obstack.h
index 2802888763..0e7eb09054 100644
--- a/malloc/obstack.h
+++ b/malloc/obstack.h
@@ -1,5 +1,5 @@
 /* obstack.h - object stack macros
-   Copyright (C) 1988,89,90,91,92,93,94,96 Free Software Foundation, Inc.
+   Copyright (C) 1988,89,90,91,92,93,94,96,97 Free Software Foundation, Inc.
 
    This file is part of the GNU C Library.  Its master source is NOT part of
    the C library, however.  The master source lives in /gd/gnu/lib.
@@ -144,9 +144,12 @@ Summary:
 
 #if defined (_LIBC) || defined (HAVE_STRING_H)
 #include <string.h>
+#define _obstack_memcpy(To, From, N) memcpy ((To), (From), (N))
 #else
-#ifndef memcpy
-#define memcpy(To, From, N) bcopy (From, To, N)
+#ifdef memcpy
+#define _obstack_memcpy(To, From, N) memcpy ((To), (From), (N))
+#else
+#define _obstack_memcpy(To, From, N) bcopy ((From), (To), (N))
 #endif
 #endif
 
@@ -377,7 +380,7 @@ __extension__								\
    int __len = (length);						\
    if (__o->next_free + __len > __o->chunk_limit)			\
      _obstack_newchunk (__o, __len);					\
-   memcpy (__o->next_free, (char *) (where), __len);			\
+   _obstack_memcpy (__o->next_free, (char *) (where), __len);		\
    __o->next_free += __len;						\
    (void) 0; })
 
@@ -387,7 +390,7 @@ __extension__								\
    int __len = (length);						\
    if (__o->next_free + __len + 1 > __o->chunk_limit)			\
      _obstack_newchunk (__o, __len + 1);				\
-   memcpy (__o->next_free, (char *) (where), __len);			\
+   _obstack_memcpy (__o->next_free, (char *) (where), __len);		\
    __o->next_free += __len;						\
    *(__o->next_free)++ = 0;						\
    (void) 0; })
@@ -499,14 +502,14 @@ __extension__								\
 ( (h)->temp = (length),							\
   (((h)->next_free + (h)->temp > (h)->chunk_limit)			\
    ? (_obstack_newchunk ((h), (h)->temp), 0) : 0),			\
-  memcpy ((h)->next_free, (char *) (where), (h)->temp),			\
+  _obstack_memcpy ((h)->next_free, (char *) (where), (h)->temp),	\
   (h)->next_free += (h)->temp)
 
 #define obstack_grow0(h,where,length)					\
 ( (h)->temp = (length),							\
   (((h)->next_free + (h)->temp + 1 > (h)->chunk_limit)			\
    ? (_obstack_newchunk ((h), (h)->temp + 1), 0) : 0),			\
-  memcpy ((h)->next_free, (char *) (where), (h)->temp),			\
+  _obstack_memcpy ((h)->next_free, (char *) (where), (h)->temp),	\
   (h)->next_free += (h)->temp,						\
   *((h)->next_free)++ = 0)
 
diff --git a/manual/Makefile b/manual/Makefile
index 9557505b04..0f525be731 100644
--- a/manual/Makefile
+++ b/manual/Makefile
@@ -118,11 +118,11 @@ realclean: distclean
 
 .PHONY: install subdir_install installdirs install-data
 install-data subdir_install: install
-install: $(infodir)/libc.info
+install: $(inst_infodir)/libc.info
 # Catchall implicit rule for other installation targets from the parent.
 install-%: ;
 
-$(infodir)/libc.info: libc.info installdirs
+$(inst_infodir)/libc.info: libc.info installdirs
 	for file in $<*; do \
 	  name=`basename $$file`; \
 	  $(INSTALL_DATA) $$file \
@@ -130,7 +130,7 @@ $(infodir)/libc.info: libc.info installdirs
 	done
 
 installdirs: $(firstword $(wildcard mkinstalldirs ../mkinstalldirs))
-	$(dir $<)$(notdir $<) $(infodir)
+	$(dir $<)$(notdir $<) $(inst_infodir)
 
 .PHONY: dist
 dist: # glibc-doc-$(edition).tar.gz
diff --git a/misc/regexp.h b/misc/regexp.h
index e31407e6ed..f31b1af1d0 100644
--- a/misc/regexp.h
+++ b/misc/regexp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
 
@@ -100,7 +100,7 @@ compile (char *__instring, char *__expbuf, __const char *__endbuf, int __eof)
   size_t __input_size = 0;
   size_t __current_size;
   int __ch;
-  int __result;
+  int __error;
 
   /* Align the expression buffer according to the needs for an object
      of type `regex_t'.  Then check for minimum size of the buffer for
@@ -169,7 +169,7 @@ compile (char *__instring, char *__expbuf, __const char *__endbuf, int __eof)
       case REG_EESCAPE:
       case REG_BADRPT:
       case REG_EEND:
-      case REG_RPAREN:
+      case REG_ERPAREN:
       default:
 	/* There is no matching error code.  */
 	RETURN (36);
diff --git a/po/Makefile b/po/Makefile
index ffaecaadaf..32cdc2d530 100644
--- a/po/Makefile
+++ b/po/Makefile
@@ -41,7 +41,7 @@ include ../Makeconfig
 -include $(common-objpfx)version.mk
 
 # Pattern for where message catalog object for language % gets installed.
-mo-installed = $(localedir)/%/LC_MESSAGES/$(domainname).mo
+mo-installed = $(inst_localedir)/%/LC_MESSAGES/$(domainname).mo
 
 # Files to install: a $(domainname).mo file for each language.
 install-others = $(LINGUAS:%=$(mo-installed))
diff --git a/posix/getopt.c b/posix/getopt.c
index f57f281297..eac576b83e 100644
--- a/posix/getopt.c
+++ b/posix/getopt.c
@@ -52,7 +52,7 @@
    program understand `configure --with-gnu-libc' and omit the object files,
    it is simpler to just do this in the source for each such file.  */
 
-#define GETOPT_INTERFACE_VERSION 1
+#define GETOPT_INTERFACE_VERSION 2
 #if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2
 #include <gnu-versions.h>
 #if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
diff --git a/posix/getopt1.c b/posix/getopt1.c
index 19fd4a0cb5..8347bb1331 100644
--- a/posix/getopt1.c
+++ b/posix/getopt1.c
@@ -43,7 +43,7 @@
    program understand `configure --with-gnu-libc' and omit the object files,
    it is simpler to just do this in the source for each such file.  */
 
-#define GETOPT_INTERFACE_VERSION 1
+#define GETOPT_INTERFACE_VERSION 2
 #if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2
 #include <gnu-versions.h>
 #if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
diff --git a/stdio-common/Makefile b/stdio-common/Makefile
index e7c1cb8c52..814374b8ae 100644
--- a/stdio-common/Makefile
+++ b/stdio-common/Makefile
@@ -43,8 +43,7 @@ tests := tst-printf tstscanf test_rdwr test-popen tstgetln test-fseek \
 	 xbug errnobug \
 	 bug1 bug2 bug3 bug4 bug5 bug6 bug7 bug8 bug9 bug10 bug11 \
 	 tfformat tiformat tstdiomisc \
-	 scanf1 scanf2 scanf3 scanf4 scanf5 scanf7 scanf8 scanf9 scanf10 \
-	 scanf11
+	 scanf1 scanf2 scanf3 scanf4 scanf5 scanf7 scanf8 scanf9 scanf10
 
 
 include ../Rules
diff --git a/stdio-common/bug10.c b/stdio-common/bug10.c
index 5e8ae25021..3e15526a43 100644
--- a/stdio-common/bug10.c
+++ b/stdio-common/bug10.c
@@ -14,7 +14,7 @@ main (int arc, char *argv)
   printf("Result of sscanf = %d\n", res);
   printf("Scanned format %%u = %u\n", val);
   printf("Possibly scanned format %%n = %d\n", n);
-  result |= res != 2 || val != 111 || n != 3;
+  result |= res != 1 || val != 111 || n != 3;
 
 
   result |= sscanf ("", " %n", &n) == EOF;
diff --git a/stdio-common/scanf1.c b/stdio-common/scanf1.c
index 58c78c2292..be6d63e997 100644
--- a/stdio-common/scanf1.c
+++ b/stdio-common/scanf1.c
@@ -9,7 +9,7 @@ main (int argc, char *argv[])
   n = i = r = -1;
   r = sscanf ("1234:567", "%d%n", &i, &n);
   printf ("%d %d %d\n", r, n, i);
-  if (r != 2 || i != 1234 || n != 4)
+  if (r != 1 || i != 1234 || n != 4)
     abort ();
   return 0;
 }
diff --git a/stdio-common/scanf10.c b/stdio-common/scanf10.c
index 27a5e66a9e..f8961378ef 100644
--- a/stdio-common/scanf10.c
+++ b/stdio-common/scanf10.c
@@ -11,5 +11,5 @@ main (int argc, char *argv[])
 
   printf ("retc=%d a=%d b=%d\n", retc, a, b);
 
-  return retc == 2 && a == 6 && b == 12 ? 0 : 1;
+  return retc == -1 && a == 6 && b == 12 ? 0 : 1;
 }
diff --git a/stdio-common/scanf3.c b/stdio-common/scanf3.c
index 5bfa80b62f..33495cca79 100644
--- a/stdio-common/scanf3.c
+++ b/stdio-common/scanf3.c
@@ -13,7 +13,7 @@ main(int arc, char *argv[])
   printf("Result of sscanf = %d\n", res);
   printf("Scanned format %%u = %u\n", val);
   printf("Possibly scanned format %%n = %d\n", n);
-  if (n != 3 || val != 111 || res != 2)
+  if (n != 3 || val != 111 || res != 1)
     abort ();
 
   val = n = -1;
@@ -21,7 +21,7 @@ main(int arc, char *argv[])
   printf("Result of sscanf = %d\n", res);
   printf("Scanned format %%u = %u\n", val);
   printf("Possibly scanned format %%n = %d\n", n);
-  if (n != 3 || val != 111 || res != 2)
+  if (n != 3 || val != 111 || res != 1)
     abort ();
 
   return 0;
diff --git a/stdio-common/tstdiomisc.c b/stdio-common/tstdiomisc.c
index dbce6237c9..8dac4f2039 100644
--- a/stdio-common/tstdiomisc.c
+++ b/stdio-common/tstdiomisc.c
@@ -27,7 +27,7 @@ t2 (void)
   SCAN ("12345", "%ld", N, 1, 12345);
   SCAN ("12345", "%llllld", N, 0, -1);
   SCAN ("12345", "%LLLLLd", N, 0, -1);
-  SCAN ("test ", "%*s%n",  n, 1, 4);
+  SCAN ("test ", "%*s%n",  n, 0, 4);
   SCAN ("test ",   "%2*s%n",  n, 0, -1);
   SCAN ("12 ",   "%l2d",  n, 0, -1);
   SCAN ("12 ",   "%2ld",  N, 1, 12);
diff --git a/stdio-common/vfscanf.c b/stdio-common/vfscanf.c
index ef0dbeea32..f201c46775 100644
--- a/stdio-common/vfscanf.c
+++ b/stdio-common/vfscanf.c
@@ -462,7 +462,35 @@ __vfscanf (FILE *s, const char *format, va_list argptr)
 		*ARG (short int *) = read_in;
 	      else
 		*ARG (int *) = read_in;
+
+#ifdef NO_BUG_IN_ISO_C_CORRIGENDUM_1
+	      /* We have a severe problem here.  The ISO C standard
+		 contradicts itself in explaining the effect of the %n
+		 format in `scanf'.  While in ISO C:1990 and the ISO C
+		 Amendement 1:1995 the result is described as
+
+		   Execution of a %n directive does not effect the
+		   assignment count returned at the completion of
+		   execution of the f(w)scanf function.
+
+		 in ISO C Corrigendum 1:1994 the following was added:
+
+		   Subclause 7.9.6.2
+		   Add the following fourth example:
+		     In:
+		       #include <stdio.h>
+		       int d1, d2, n1, n2, i;
+		       i = sscanf("123", "%d%n%n%d", &d1, &n1, &n2, &d2);
+		     the value 123 is assigned to d1 and the value3 to n1.
+		     Because %n can never get an input failure the value
+		     of 3 is also assigned to n2.  The value of d2 is not
+		     affected.  The value 3 is assigned to i.
+
+		 We go for now with the historically correct code fro ISO C,
+		 i.e., we don't count the %n assignments.  When it ever
+		 should proof to be wrong just remove the #ifdef above.  */
 	      ++done;
+#endif
 	    }
 	  break;
 
diff --git a/sunrpc/Makefile b/sunrpc/Makefile
index ef8b354756..241eca5a25 100644
--- a/sunrpc/Makefile
+++ b/sunrpc/Makefile
@@ -53,8 +53,8 @@ headers = $(addprefix rpc/,auth.h auth_unix.h clnt.h netdb.h pmap_clnt.h \
 rpcsvc = bootparam.x nlm_prot.x rstat.x \
 	 yppasswd.x klm_prot.x rex.x sm_inter.x mount.x \
 	 rusers.x spray.x nfs_prot.x rquota.x
-install-others = $(includedir)/rpcsvc/bootparam_prot.h \
-		 $(sysconfdir)/rpc
+install-others = $(inst_includedir)/rpcsvc/bootparam_prot.h \
+		 $(inst_sysconfdir)/rpc
 generated = $(rpcsvc:%.x=rpcsvc/%.h) $(rpcsvc:%.x=x%.c)
 
 routines := auth_none auth_unix authuxprot bindrsvprt \
@@ -103,12 +103,13 @@ rpcgen-cmd = $(built-program-cmd)
 # The proper file name is longer than 14 chars, so we install it under
 # a shorter name.  But if the filesystem can handle it, we want to
 # install under the proper name as well.
-$(includedir)/rpcsvc/bootparam_prot.h: $(includedir)/rpcsvc/bootparam.h
+$(inst_includedir)/rpcsvc/bootparam_prot.h: \
+  $(inst_includedir)/rpcsvc/bootparam.h
 	@echo It is safe to ignore an error here if this file name is too long.
 	-$(do-install)
 
 # Install the rpc data base file.
-$(sysconfdir)/rpc: etc.rpc
+$(inst_sysconfdir)/rpc: etc.rpc
 	$(do-install)
 
 defines := $(defines) -D_PATH_RPC='"$(sysconfdir)/rpc"'
diff --git a/sysdeps/mach/hurd/Makefile b/sysdeps/mach/hurd/Makefile
index b68d53879d..618ad1d3e4 100644
--- a/sysdeps/mach/hurd/Makefile
+++ b/sysdeps/mach/hurd/Makefile
@@ -98,9 +98,9 @@ common-generated += errnos.d stamp-errnos
 libc-name = crt
 
 ifeq (,$(subdir))
-install-others += $(libdir)/libc.a $(libdir)/libc_p.a
-$(libdir)/libc.a: $(hurd)/libc-ldscript; $(do-install)
-$(libdir)/libc_p.a: $(hurd)/libc_p-ldscript; $(do-install)
+install-others += $(inst_libdir)/libc.a $(inst_libdir)/libc_p.a
+$(inst_libdir)/libc.a: $(hurd)/libc-ldscript; $(do-install)
+$(inst_libdir)/libc_p.a: $(hurd)/libc_p-ldscript; $(do-install)
 endif
 
 # Make sure these are used to build the libc.so shared object too.
@@ -110,7 +110,7 @@ $(common-objpfx)libc.so: $(rpcuserlibs)
 rpath-link := $(rpath-link):$(common-objpfx)mach:$(common-objpfx)hurd
 
 # And get them into the libc.so ldscript.
-$(libdir)/libc.so: $(rpcuserlibs)
+$(inst_libdir)/libc.so: $(rpcuserlibs)
 
 # The RPC stubs from these libraries are needed in building the dynamic
 # linker, too.  It must be self-contained, so we link the needed PIC
diff --git a/sysdeps/mach/hurd/configure b/sysdeps/mach/hurd/configure
index ab0a8021d0..99497b81df 100755
--- a/sysdeps/mach/hurd/configure
+++ b/sysdeps/mach/hurd/configure
@@ -1,4 +1,7 @@
  
+# GNU libc on the Hurd is always reentrant.
+DEFINES="$DEFINES -D_LIBC_REENTRANT"
+
 # Don't bother trying to generate any glue code to be compatible with the
 # existing system library, because we are the only system library.
 inhibit_glue=yes
diff --git a/sysdeps/mach/hurd/configure.in b/sysdeps/mach/hurd/configure.in
index d9ebba5f4b..29bb7e07b9 100644
--- a/sysdeps/mach/hurd/configure.in
+++ b/sysdeps/mach/hurd/configure.in
@@ -1,6 +1,9 @@
 sinclude(./aclocal.m4)dnl Autoconf lossage.
 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
 
+# GNU libc on the Hurd is always reentrant.
+DEFINES="$DEFINES -D_LIBC_REENTRANT"
+
 # Don't bother trying to generate any glue code to be compatible with the
 # existing system library, because we are the only system library.
 inhibit_glue=yes
diff --git a/sysdeps/mach/hurd/getdents.c b/sysdeps/mach/hurd/getdents.c
index 4de2eb351d..61b11accd1 100644
--- a/sysdeps/mach/hurd/getdents.c
+++ b/sysdeps/mach/hurd/getdents.c
@@ -1,23 +1,21 @@
-/* Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Ince	
+/* Copyright (C) 1992, 1993, 1994, 1995, 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
 
-This file is part of the GNU C Library.
+   The GNU C Library is free software; you can redistribute it and/or
+   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 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.
 
-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.  */
 
-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., 675 Mass Ave,
-Cambridge, MA 02139, USA.  */
-
-#include <ansidecl.h>
 #include <stddef.h>
 #include <errno.h>
 #include <sys/types.h>
@@ -26,8 +24,11 @@ Cambridge, MA 02139, USA.  */
 #include <string.h>
 
 ssize_t
-DEFUN(__getdirentries, (fd, buf, nbytes, basep),
-      int fd AND PTR buf AND size_t nbytes AND off_t *basep)
+__getdirentries (fd, buf, nbytes, basep)
+     int fd;
+     char *buf;
+     size_t nbytes;
+     off_t *basep;
 {
   error_t err;
   int entriesread;
@@ -59,4 +60,3 @@ DEFUN(__getdirentries, (fd, buf, nbytes, basep),
 }
 
 weak_alias (__getdirentries, getdirentries)
-
diff --git a/sysdeps/mach/hurd/vdprintf.c b/sysdeps/mach/hurd/vdprintf.c
index 415258c6b6..e14c295f3e 100644
--- a/sysdeps/mach/hurd/vdprintf.c
+++ b/sysdeps/mach/hurd/vdprintf.c
@@ -1,20 +1,20 @@
 /* Copyright (C) 1991, 1992, 1993, 1997 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+   This file is part of the GNU C Library.
 
-The GNU C Library is free software; you can redistribute it and/or
-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 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.
+   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., 675 Mass Ave,
-Cambridge, MA 02139, USA.  */
+   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 <limits.h>
@@ -33,14 +33,14 @@ vdprintf (int d, const char *format, va_list arg)
   struct hurd_fd *fd;
 
   HURD_CRITICAL_BEGIN;
-  fd = _hurd_fd_get (d);
+  fd = _hurd_fd_get (fd);
   HURD_CRITICAL_END;
 
   if (!fd)
     return 0;
 
   /* Create an unbuffered stream talking to D on the stack.  */
-  memset ((void *) &f, 0, sizeof(f));
+  memset ((void *) &f, 0, sizeof (f));
   f.__magic = _IOMAGIC;
   f.__mode.__write = 1;
   f.__cookie = fd;
diff --git a/sysdeps/posix/pipestream.c b/sysdeps/posix/pipestream.c
index d954f1412c..6041f830e7 100644
--- a/sysdeps/posix/pipestream.c
+++ b/sysdeps/posix/pipestream.c
@@ -1,20 +1,20 @@
-/* Copyright (C) 1991, 1992, 1993, 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., 675 Mass Ave,
-Cambridge, MA 02139, USA.  */
+/* Copyright (C) 1991, 1992, 1993, 1996, 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 <stddef.h>
diff --git a/sysdeps/standalone/i386/force_cpu386/Makefile b/sysdeps/standalone/i386/force_cpu386/Makefile
index 6381fdc62f..a51ed7f429 100644
--- a/sysdeps/standalone/i386/force_cpu386/Makefile
+++ b/sysdeps/standalone/i386/force_cpu386/Makefile
@@ -19,7 +19,7 @@
 # Boston, MA 02111-1307, USA.
 
 ifeq (bare,$(subdir))
-install-others += $(libdir)/force_cpu386.ld
-$(libdir)/force_cpu386.ld: $(sysdep_dir)/standalone/i386/target.ld
+install-others += $(inst_libdir)/force_cpu386.ld
+$(inst_libdir)/force_cpu386.ld: $(sysdep_dir)/standalone/i386/target.ld
 	$(do-install)
 endif
diff --git a/sysdeps/stub/getdents.c b/sysdeps/stub/getdents.c
index 6e7793a72c..a773347f50 100644
--- a/sysdeps/stub/getdents.c
+++ b/sysdeps/stub/getdents.c
@@ -1,26 +1,26 @@
-/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+/* Copyright (C) 1991, 1995, 1996, 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 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.
+   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., 675 Mass Ave,
-Cambridge, MA 02139, USA.  */
+   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 <stddef.h>
 #include <errno.h>
 #include <sys/types.h>
 
-int
+ssize_t
 __getdirentries (fd, buf, nbytes, basep)
      int fd;
      char *buf;
@@ -30,6 +30,6 @@ __getdirentries (fd, buf, nbytes, basep)
   __set_errno (ENOSYS);
   return -1;
 }
-stub_warning (getdirentries)
-
 weak_alias (__getdirentries, getdirentries)
+
+stub_warning (getdirentries)
diff --git a/sysdeps/unix/bsd/sony/newsos4/Makefile b/sysdeps/unix/bsd/sony/newsos4/Makefile
index 7cfecf2e18..053da568d8 100644
--- a/sysdeps/unix/bsd/sony/newsos4/Makefile
+++ b/sysdeps/unix/bsd/sony/newsos4/Makefile
@@ -1,3 +1,3 @@
-ifeq ($(subdir), posix)
+ifeq ($(subdir),posix)
 sysdep_routines := $(sysdep_routines) sys_wait4
 endif
diff --git a/sysdeps/unix/bsd/sun/sunos4/Makefile b/sysdeps/unix/bsd/sun/sunos4/Makefile
index 96b88e1b72..d17654a30f 100644
--- a/sysdeps/unix/bsd/sun/sunos4/Makefile
+++ b/sysdeps/unix/bsd/sun/sunos4/Makefile
@@ -1,7 +1,7 @@
-ifeq ($(subdir), posix)
+ifeq ($(subdir),posix)
 sysdep_routines := $(sysdep_routines) sys_wait4
 endif
 
-ifeq ($(subdir), misc)
+ifeq ($(subdir),misc)
 sysdep_routines := $(sysdep_routines) sys_mmap
 endif
diff --git a/sysdeps/unix/getdents.c b/sysdeps/unix/getdents.c
index e356e96d71..54839af0db 100644
--- a/sysdeps/unix/getdents.c
+++ b/sysdeps/unix/getdents.c
@@ -20,7 +20,7 @@
 #include <sys/types.h>
 #include <unistd.h>
 
-int
+ssize_t
 __getdirentries (fd, buf, nbytes, basep)
      int fd;
      char *buf;
@@ -30,7 +30,7 @@ __getdirentries (fd, buf, nbytes, basep)
   if (basep)
     *basep = __lseek (fd, (off_t) 0, SEEK_CUR);
 
-  return __read (fd, buf, nbytes);
+  return (ssize_t) __read (fd, buf, nbytes);
 }
 
 weak_alias (__getdirentries, getdirentries)
diff --git a/sysdeps/unix/readdir.c b/sysdeps/unix/readdir.c
index 97956ecd06..fd26b707a9 100644
--- a/sysdeps/unix/readdir.c
+++ b/sysdeps/unix/readdir.c
@@ -1,20 +1,20 @@
-/* Copyright (C) 1991, 92, 93, 94, 95, 96 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., 675 Mass Ave,
-Cambridge, MA 02139, USA.  */
+/* Copyright (C) 1991, 92, 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
+   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 <limits.h>
diff --git a/sysdeps/unix/sysv/Makefile b/sysdeps/unix/sysv/Makefile
index 885d3b4eca..cfb1607b3f 100644
--- a/sysdeps/unix/sysv/Makefile
+++ b/sysdeps/unix/sysv/Makefile
@@ -16,7 +16,7 @@
 # write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 # Boston, MA 02111-1307, USA.
 
-ifeq ($(subdir), termios)
+ifeq ($(subdir),termios)
 
 ifeq (,$(filter termio.h,$(sysdep_headers)))
 
diff --git a/sysdeps/unix/sysv/getdents.c b/sysdeps/unix/sysv/getdents.c
index 109f29a2b1..ef2dc23faf 100644
--- a/sysdeps/unix/sysv/getdents.c
+++ b/sysdeps/unix/sysv/getdents.c
@@ -21,9 +21,9 @@
 #include <sys/types.h>
 #include <unistd.h>
 
-extern int __getdents __P ((int fd, char *buf, size_t nbytes));
+extern ssize_t __getdents __P ((int fd, char *buf, size_t nbytes));
 
-int
+ssize_t
 __getdirentries (fd, buf, nbytes, basep)
      int fd;
      char *buf;
diff --git a/sysdeps/unix/sysv/linux/Dist b/sysdeps/unix/sysv/linux/Dist
index b96d1dfcf6..c5a2f179ee 100644
--- a/sysdeps/unix/sysv/linux/Dist
+++ b/sysdeps/unix/sysv/linux/Dist
@@ -1,6 +1,5 @@
 init-first.h
 kernel_sigaction.h
-kernel_termios.h
 llseek.c
 siglist.h
 sysctl.c
@@ -18,6 +17,7 @@ sys/debugreg.h
 sys/io.h
 sys/kd.h
 sys/kdaemon.h
+sys/kernel_termios.h
 sys/klog.h
 sys/module.h
 sys/mount.h
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index 97fb5f14a5..ae2e294785 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -1,10 +1,10 @@
-ifeq ($(subdir), csu)
+ifeq ($(subdir),csu)
 CFLAGS-init-first.c = -fkeep-inline-functions
 
 sysdep_routines += errno-loc
 endif
 
-ifeq ($(subdir), misc)
+ifeq ($(subdir),misc)
 sysdep_routines += sysctl clone llseek
 
 sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h sys/mtio.h \
@@ -28,29 +28,29 @@ $(objpfx)syscall-%.h $(objpfx)syscall-%.d: ../sysdeps/unix/sysv/linux/sys/syscal
 generated += syscall-list.h syscall-list.d
 endif
 
-ifeq ($(subdir), time)
+ifeq ($(subdir),time)
 sysdep_headers += sys/timex.h
 endif
 
-ifeq ($(subdir), socket)
+ifeq ($(subdir),socket)
 sysdep_headers += sys/socketcall.h net/if.h net/if_ppp.h net/ppp-comp.h \
 		  net/ppp_defs.h net/if_arp.h net/route.h
 endif
 
-ifeq ($(subdir), sunrpc)
+ifeq ($(subdir),sunrpc)
 sysdep_headers += nfs/nfs.h
 endif
 
-ifeq ($(subdir), termios)
-sysdep_headers += termio.h
+ifeq ($(subdir),termios)
+sysdep_headers += termio.h sys/kernel_termios.h
 endif
 
-ifeq ($(subdir), stdio-common)
+ifeq ($(subdir),stdio-common)
 # Just disable the auto generation in sysdeps/generic
 inhibit-siglist := yes
 endif
 
-ifeq ($(subdir), inet)
+ifeq ($(subdir),inet)
 sysdep_headers += netinet/in_systm.h sys/socketvar.h
 endif
 
diff --git a/sysdeps/unix/sysv/linux/alpha/Dist b/sysdeps/unix/sysv/linux/alpha/Dist
index cdb11e98d0..f3c4cb92d6 100644
--- a/sysdeps/unix/sysv/linux/alpha/Dist
+++ b/sysdeps/unix/sysv/linux/alpha/Dist
@@ -4,7 +4,7 @@ ioperm.c
 init-first.h
 clone.S
 sys/io.h
-kernel_sigaction.h
 kernel_termios.h
 sys/acct.h
+sys/kernel_sigaction.h
 sys/procfs.h
diff --git a/sysdeps/unix/sysv/linux/alpha/Makefile b/sysdeps/unix/sysv/linux/alpha/Makefile
index 3908b5703c..fa2c078664 100644
--- a/sysdeps/unix/sysv/linux/alpha/Makefile
+++ b/sysdeps/unix/sysv/linux/alpha/Makefile
@@ -1,4 +1,4 @@
-ifeq ($(subdir), misc)
+ifeq ($(subdir),misc)
 sysdep_headers += alpha/ptrace.h alpha/regdef.h
 
 sysdep_routines += ieee_get_fp_control ieee_set_fp_control \
diff --git a/sysdeps/unix/sysv/linux/alpha/ioctls.h b/sysdeps/unix/sysv/linux/alpha/ioctls.h
new file mode 100644
index 0000000000..80b2e62e77
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/alpha/ioctls.h
@@ -0,0 +1,39 @@
+/* Copyright (C) 1996, 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 _IOCTLS_H
+#define _IOCTLS_H 1
+
+/* Use the definitions from the kernel header files.  */
+#include <asm/ioctls.h>
+#include <sys/kernel_termios.h>
+
+/* Oh well, this is necessary since the kernel data structure is
+   different from the user-level version.  */
+#undef  TCGETS
+#undef  TCSETS
+#undef  TCSETSW
+#undef  TCSETSF
+#define TCGETS	_IOR ('t', 19, struct __kernel_termios)
+#define TCSETS	_IOW ('t', 20, struct __kernel_termios)
+#define TCSETSW	_IOW ('t', 21, struct __kernel_termios)
+#define TCSETSF	_IOW ('t', 22, struct __kernel_termios)
+
+#include <linux/sockios.h>
+
+#endif /* ioctls.h  */
diff --git a/sysdeps/unix/sysv/linux/alpha/ioperm.c b/sysdeps/unix/sysv/linux/alpha/ioperm.c
index 924fc473b2..488265a069 100644
--- a/sysdeps/unix/sysv/linux/alpha/ioperm.c
+++ b/sysdeps/unix/sysv/linux/alpha/ioperm.c
@@ -1,36 +1,36 @@
-/* Copyright (C) 1992, 1996 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
-Contributed by David Mosberger.
+/* Copyright (C) 1992, 1996, 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David Mosberger.
 
-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 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.
+   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., 675 Mass Ave,
-Cambridge, MA 02139, USA.  */
+   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.  */
 
 /* I/O access is restricted to ISA port space (ports 0..65535).
-Modern devices hopefully are sane enough not to put any performance
-critical registers in i/o space.
+   Modern devices hopefully are sane enough not to put any performance
+   critical registers in i/o space.
 
-On the first call to ioperm() or _sethae(), the entire (E)ISA port
-space is mapped into the virtual address space at address io.base.
-mprotect() calls are then used to enable/disable access to ports.  Per
-page, there are PAGE_SIZE>>IO_SHIFT I/O ports (e.g., 256 ports on a
-Low Cost Alpha based system using 8KB pages).
+   On the first call to ioperm() or _sethae(), the entire (E)ISA port
+   space is mapped into the virtual address space at address io.base.
+   mprotect() calls are then used to enable/disable access to ports.  Per
+   page, there are PAGE_SIZE>>IO_SHIFT I/O ports (e.g., 256 ports on a
+   Low Cost Alpha based system using 8KB pages).
 
-Keep in mind that this code should be able to run in a 32bit address
-space.  It is therefore unreasonable to expect mmap'ing the entire
-sparse address space would work (e.g., the Low Cost Alpha chip has an
-I/O address space that's 512MB large!).  */
+   Keep in mind that this code should be able to run in a 32bit address
+   space.  It is therefore unreasonable to expect mmap'ing the entire
+   sparse address space would work (e.g., the Low Cost Alpha chip has an
+   I/O address space that's 512MB large!).  */
 
 #include <errno.h>
 #include <fcntl.h>
@@ -66,27 +66,30 @@ I/O address space that's 512MB large!).  */
 #define CIA_SPARSE_MEM		(0xfffffc8000000000UL)
 #define CIA_DENSE_MEM		(0xfffffc8600000000UL)
 
+#define T2_IO_BASE		(0xfffffc03a0000000UL)
+#define T2_SPARSE_BASE		(0xfffffc0200000000UL)
+#define T2_DENSE_BASE		(0xfffffc03c0000000UL)
 
-enum {
-  IOSYS_JENSEN = 0, IOSYS_APECS = 1, IOSYS_CIA = 2
+typedef enum {
+  IOSYS_UNKNOWN, IOSYS_JENSEN, IOSYS_APECS, IOSYS_CIA, IOSYS_T2
 } iosys_t;
 
 struct ioswtch {
-  void		(*sethae)(unsigned long addr);
-  void		(*outb)(unsigned char b, unsigned long port);
-  void		(*outw)(unsigned short b, unsigned long port);
-  void		(*outl)(unsigned int b, unsigned long port);
-  unsigned int	(*inb)(unsigned long port);
-  unsigned int	(*inw)(unsigned long port);
-  unsigned int	(*inl)(unsigned long port);
+  void		(*sethae)(unsigned long int addr);
+  void		(*outb)(unsigned char b, unsigned long int port);
+  void		(*outw)(unsigned short b, unsigned long int port);
+  void		(*outl)(unsigned int b, unsigned long int port);
+  unsigned int	(*inb)(unsigned long int port);
+  unsigned int	(*inw)(unsigned long int port);
+  unsigned int	(*inl)(unsigned long int port);
 };
 
 static struct platform {
-  const char	*name;
-  int		io_sys;
-  int		hae_shift;
-  unsigned long	bus_memory_base;
-  unsigned long	sparse_bus_memory_base;
+  const char	   *name;
+  int		    io_sys;
+  iosys_t	    hae_shift;
+  unsigned long	int bus_memory_base;
+  unsigned long	int sparse_bus_memory_base;
 } platform[] = {
   {"Alcor",	IOSYS_CIA,	5, CIA_DENSE_MEM,	CIA_SPARSE_MEM},
   {"Avanti",	IOSYS_APECS,	5, APECS_DENSE_MEM,	APECS_SPARSE_MEM},
@@ -99,27 +102,29 @@ static struct platform {
   {"Mikasa",	IOSYS_APECS,	5, APECS_DENSE_MEM,	APECS_SPARSE_MEM},
   {"Mustang",	IOSYS_APECS,	5, APECS_DENSE_MEM,	APECS_SPARSE_MEM},
   {"Noname",	IOSYS_APECS,	5, APECS_DENSE_MEM,	APECS_SPARSE_MEM},
+  {"Sable",	IOSYS_T2,	5, T2_DENSE_MEM,	T2_SPARSE_MEM},
 };
 
 
 static struct {
   struct hae {
-    unsigned long	cache;
-    unsigned long *	reg;
+    unsigned long int	cache;
+    unsigned long int *	reg;
   } hae;
-  unsigned long		base;
+  unsigned long int	base;
   struct ioswtch *	swp;
-  int			sys;
+  unsigned long int	bus_memory_base;
+  unsigned long int	sparse_bus_memory_base;
+  unsigned long int	io_base;
+  iosys_t		sys;
   int			hae_shift;
-  unsigned long		bus_memory_base;
-  unsigned long		sparse_bus_memory_base;
 } io;
 
-extern void __sethae (unsigned long);	/* we can't use asm/io.h */
+extern void __sethae (unsigned long int);	/* we can't use asm/io.h */
 
 
-static inline unsigned long
-port_to_cpu_addr (unsigned long port, int iosys, int size)
+static inline unsigned long int
+port_to_cpu_addr (unsigned long int port, iosys_t iosys, int size)
 {
   if (iosys == IOSYS_JENSEN)
     return (port << 7) + ((size - 1) << 5) + io.base;
@@ -129,7 +134,7 @@ port_to_cpu_addr (unsigned long port, int iosys, int size)
 
 
 static inline void
-inline_sethae (unsigned long addr, int iosys)
+inline_sethae (unsigned long int addr, iosys_t iosys)
 {
   if (iosys == IOSYS_JENSEN)
     {
@@ -143,7 +148,7 @@ inline_sethae (unsigned long addr, int iosys)
     }
   else
     {
-      unsigned long msb;
+      unsigned long int msb;
 
       /* no need to set hae if msb is 0: */
       msb = addr & 0xf8000000;
@@ -157,10 +162,10 @@ inline_sethae (unsigned long addr, int iosys)
 
 
 static inline void
-inline_outb (unsigned char b, unsigned long port, int iosys)
+inline_outb (unsigned char b, unsigned long int port, iosys_t iosys)
 {
   unsigned int w;
-  unsigned long addr = port_to_cpu_addr (port, iosys, 1);
+  unsigned long int addr = port_to_cpu_addr (port, iosys, 1);
 
   inline_sethae (0, iosys);
   asm ("insbl %2,%1,%0" : "r=" (w) : "ri" (port & 0x3), "r" (b));
@@ -170,10 +175,10 @@ inline_outb (unsigned char b, unsigned long port, int iosys)
 
 
 static inline void
-inline_outw (unsigned short b, unsigned long port, int iosys)
+inline_outw (unsigned short int b, unsigned long int port, iosys_t iosys)
 {
   unsigned int w;
-  unsigned long addr = port_to_cpu_addr (port, iosys, 2);
+  unsigned long int addr = port_to_cpu_addr (port, iosys, 2);
 
   inline_sethae (0, iosys);
   asm ("inswl %2,%1,%0" : "r=" (w) : "ri" (port & 0x3), "r" (b));
@@ -183,9 +188,9 @@ inline_outw (unsigned short b, unsigned long port, int iosys)
 
 
 static inline void
-inline_outl (unsigned int b, unsigned long port, int iosys)
+inline_outl (unsigned int b, unsigned long int port, iosys_t iosys)
 {
-  unsigned long addr = port_to_cpu_addr (port, iosys, 4);
+  unsigned long int addr = port_to_cpu_addr (port, iosys, 4);
 
   if (port >= MAX_PORT)
     return;
@@ -197,9 +202,9 @@ inline_outl (unsigned int b, unsigned long port, int iosys)
 
 
 static inline unsigned int
-inline_inb (unsigned long port, int iosys)
+inline_inb (unsigned long int port, iosys_t iosys)
 {
-  unsigned long result, addr = port_to_cpu_addr (port, iosys, 1);
+  unsigned long int result, addr = port_to_cpu_addr (port, iosys, 1);
 
   inline_sethae (0, iosys);
   result = *(vuip) addr;
@@ -209,9 +214,9 @@ inline_inb (unsigned long port, int iosys)
 
 
 static inline unsigned int
-inline_inw (unsigned long port, int iosys)
+inline_inw (unsigned long int port, iosys_t iosys)
 {
-  unsigned long result, addr = port_to_cpu_addr (port, iosys, 2);
+  unsigned long int result, addr = port_to_cpu_addr (port, iosys, 2);
 
   inline_sethae (0, iosys);
   result = *(vuip) addr;
@@ -221,9 +226,9 @@ inline_inw (unsigned long port, int iosys)
 
 
 static inline unsigned int
-inline_inl (unsigned long port, int iosys)
+inline_inl (unsigned long int port, iosys_t iosys)
 {
-  unsigned long addr = port_to_cpu_addr (port, iosys, 4);
+  unsigned long int addr = port_to_cpu_addr (port, iosys, 4);
 
   inline_sethae (0, iosys);
   return *(vuip) addr;
@@ -232,14 +237,14 @@ inline_inl (unsigned long port, int iosys)
 
 #define DCL_SETHAE(name, iosys)			\
 static void						\
-name##_sethae (unsigned long addr)			\
+name##_sethae (unsigned long int addr)			\
 {							\
   inline_sethae (addr, IOSYS_##iosys);			\
 }
 
 #define DCL_OUT(name, func, type, iosys)		\
 static void						\
-name##_##func (unsigned type b, unsigned long addr)	\
+name##_##func (unsigned type b, unsigned long int addr)	\
 {							\
   inline_##func (b, addr, IOSYS_##iosys);		\
 }
@@ -247,7 +252,7 @@ name##_##func (unsigned type b, unsigned long addr)	\
 
 #define DCL_IN(name, func, iosys)			\
 static unsigned int					\
-name##_##func (unsigned long addr)			\
+name##_##func (unsigned long int addr)			\
 {							\
   return inline_##func (addr, IOSYS_##iosys);		\
 }
@@ -255,7 +260,7 @@ name##_##func (unsigned long addr)			\
 
 DCL_SETHAE(jensen, JENSEN)
 DCL_OUT(jensen, outb, char,  JENSEN)
-DCL_OUT(jensen, outw, short, JENSEN)
+DCL_OUT(jensen, outw, short int, JENSEN)
 DCL_OUT(jensen, outl, int,   JENSEN)
 DCL_IN(jensen, inb, JENSEN)
 DCL_IN(jensen, inw, JENSEN)
@@ -266,7 +271,7 @@ DCL_IN(jensen, inl, JENSEN)
 
 DCL_SETHAE(apecs, APECS)
 DCL_OUT(apecs, outb, char,  APECS)
-DCL_OUT(apecs, outw, short, APECS)
+DCL_OUT(apecs, outw, short int, APECS)
 DCL_OUT(apecs, outl, int,   APECS)
 DCL_IN(apecs, inb, APECS)
 DCL_IN(apecs, inw, APECS)
@@ -291,6 +296,10 @@ struct ioswtch ioswtch[] = {
  * with, we first try to read the value of symlink PATH_ALPHA_SYSTYPE,
  * if that fails, we lookup the "system type" field in /proc/cpuinfo.
  * If that fails as well, we give up.
+ *
+ * If the value received from PATH_ALPHA_SYSTYPE begins with a number,
+ * assume this is a previously unsupported system and the values encode,
+ * in order, "<io_base>,<hae_shift>,<dense_base>,<sparse_base>".
  */
 static int
 init_iosys (void)
@@ -298,10 +307,21 @@ init_iosys (void)
   char systype[256];
   int i, n;
 
-  n = readlink(PATH_ALPHA_SYSTYPE, systype, sizeof(systype) - 1);
+  n = readlink (PATH_ALPHA_SYSTYPE, systype, sizeof (systype) - 1);
   if (n > 0)
     {
       systype[n] = '\0';
+      if (isdigit (systype[0]))
+	{
+	  if (sscanf (systype, "%li,%i,%li,%li", &io.io_base, &io.hae_shift,
+		      &io.bus_memory_base, &io.sparse_bus_memory_base) == 4)
+	    {
+	      io.sys = IOSYS_UNKNOWN;
+	      io.swp = &ioswtch[1];
+	      return 0;
+	    }
+	  /* else we're likely going to fail with the system match below */
+	}
     }
   else
     {
@@ -318,14 +338,14 @@ init_iosys (void)
 	  else
 	    fgets (systype, 256, fp);
 	}
-      fclose(fp);
+      fclose (fp);
 
       if (n == EOF)
 	{
 	  /* this can happen if the format of /proc/cpuinfo changes...  */
-	  fprintf(stderr,
-		  "ioperm.init_iosys(): Unable to determine system type.\n"
-		  "\t(May need " PATH_ALPHA_SYSTYPE " symlink?)\n");
+	  fprintf (stderr,
+		   "ioperm.init_iosys(): Unable to determine system type.\n"
+		   "\t(May need " PATH_ALPHA_SYSTYPE " symlink?)\n");
 	  __set_errno (ENODEV);
 	  return -1;
 	}
@@ -355,9 +375,9 @@ init_iosys (void)
 
 
 int
-_ioperm (unsigned long from, unsigned long num, int turn_on)
+_ioperm (unsigned long int from, unsigned long int num, int turn_on)
 {
-  unsigned long addr, len;
+  unsigned long int addr, len;
   int prot;
 
   if (!io.swp && init_iosys () < 0)
@@ -374,7 +394,7 @@ _ioperm (unsigned long from, unsigned long num, int turn_on)
     {
       if (!io.base)
 	{
-	  unsigned long base;
+	  unsigned long int base;
 	  int fd;
 
 	  io.hae.reg   = 0;		/* not used in user-level */
@@ -387,6 +407,7 @@ _ioperm (unsigned long from, unsigned long num, int turn_on)
 
 	  switch (io.sys)
 	    {
+	    case IOSYS_UNKNOWN: base = io.io_base; break;
 	    case IOSYS_JENSEN:	base = JENSEN_IO_BASE; break;
 	    case IOSYS_APECS:	base = APECS_IO_BASE; break;
 	    case IOSYS_CIA:	base = CIA_IO_BASE; break;
@@ -398,7 +419,8 @@ _ioperm (unsigned long from, unsigned long num, int turn_on)
 	  addr &= PAGE_MASK;
 	  len = port_to_cpu_addr (MAX_PORT, io.sys, 1) - addr;
 	  io.base =
-	    (unsigned long) __mmap (0, len, PROT_NONE, MAP_SHARED, fd, base);
+	    (unsigned long int) __mmap (0, len, PROT_NONE, MAP_SHARED,
+					fd, base);
 	  close (fd);
 	  if ((long) io.base == -1)
 	    return -1;
@@ -437,7 +459,7 @@ _iopl (unsigned int level)
 
 
 void
-_sethae (unsigned long addr)
+_sethae (unsigned long int addr)
 {
   if (!io.swp && init_iosys () < 0)
     return;
@@ -447,7 +469,7 @@ _sethae (unsigned long addr)
 
 
 void
-_outb (unsigned char b, unsigned long port)
+_outb (unsigned char b, unsigned long int port)
 {
   if (port >= MAX_PORT)
     return;
@@ -457,7 +479,7 @@ _outb (unsigned char b, unsigned long port)
 
 
 void
-_outw (unsigned short b, unsigned long port)
+_outw (unsigned short b, unsigned long int port)
 {
   if (port >= MAX_PORT)
     return;
@@ -467,7 +489,7 @@ _outw (unsigned short b, unsigned long port)
 
 
 void
-_outl (unsigned int b, unsigned long port)
+_outl (unsigned int b, unsigned long int port)
 {
   if (port >= MAX_PORT)
     return;
@@ -477,27 +499,27 @@ _outl (unsigned int b, unsigned long port)
 
 
 unsigned int
-_inb (unsigned long port)
+_inb (unsigned long int port)
 {
   return io.swp->inb (port);
 }
 
 
 unsigned int
-_inw (unsigned long port)
+_inw (unsigned long int port)
 {
   return io.swp->inw (port);
 }
 
 
 unsigned int
-_inl (unsigned long port)
+_inl (unsigned long int port)
 {
   return io.swp->inl (port);
 }
 
 
-unsigned long
+unsigned long int
 _bus_base(void)
 {
   if (!io.swp && init_iosys () < 0)
@@ -505,7 +527,7 @@ _bus_base(void)
   return io.bus_memory_base;
 }
 
-unsigned long
+unsigned long int
 _bus_base_sparse(void)
 {
   if (!io.swp && init_iosys () < 0)
diff --git a/sysdeps/unix/sysv/linux/alpha/kernel_termios.h b/sysdeps/unix/sysv/linux/alpha/sys/kernel_termios.h
index cb030e4de4..eebe976ce1 100644
--- a/sysdeps/unix/sysv/linux/alpha/kernel_termios.h
+++ b/sysdeps/unix/sysv/linux/alpha/sys/kernel_termios.h
@@ -1,14 +1,14 @@
 /* The following corresponds to the values from the Linux 2.1.20 kernel.  */
 
-#define KERNEL_NCCS 19
+#define __KERNEL_NCCS 19
 
-struct kernel_termios
+struct __kernel_termios
   {
     tcflag_t c_iflag;		/* input mode flags */
     tcflag_t c_oflag;		/* output mode flags */
     tcflag_t c_cflag;		/* control mode flags */
     tcflag_t c_lflag;		/* local mode flags */
-    cc_t c_cc[KERNEL_NCCS];	/* control characters */
+    cc_t c_cc[__KERNEL_NCCS];	/* control characters */
     cc_t c_line;		/* line discipline */
     speed_t c_ispeed;		/* input speed */
     speed_t c_ospeed;		/* output speed */
diff --git a/sysdeps/unix/sysv/linux/alpha/sys/procfs.h b/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
index 03af029254..7bd6e6958d 100644
--- a/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
+++ b/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
@@ -94,7 +94,7 @@ struct elf_prpsinfo
     unsigned long int pr_flag;		/* Flags.  */
     unsigned int pr_uid;
     unsigned int pr_gid;
-    unsigned int pr_pid, pr_ppid, pr_pgrp, pr_sid;
+    int pr_pid, pr_ppid, pr_pgrp, pr_sid;
     /* Lots missing */
     char pr_fname[16];			/* Filename of executable.  */
     char pr_psargs[ELF_PRARGSZ];	/* Initial part of arg list.  */
diff --git a/sysdeps/unix/sysv/linux/alpha/syscalls.list b/sysdeps/unix/sysv/linux/alpha/syscalls.list
index cf5f439bc4..71407062fb 100644
--- a/sysdeps/unix/sysv/linux/alpha/syscalls.list
+++ b/sysdeps/unix/sysv/linux/alpha/syscalls.list
@@ -17,7 +17,6 @@ semctl		-	semctl		4	__semctl	semctl
 
 osf_sigprocmask	-	osf_sigprocmask	2	__osf_sigprocmask
 
-getdents	-	getdents	3	__getdirentries	getdirentries
 getpeername	-	getpeername	3	__getpeername	getpeername
 getpriority	-	getpriority	2	__getpriority	getpriority
 mmap		-	mmap		6	__mmap		mmap
diff --git a/sysdeps/unix/sysv/linux/configure b/sysdeps/unix/sysv/linux/configure
index 20923215ae..a6137d9ba8 100644
--- a/sysdeps/unix/sysv/linux/configure
+++ b/sysdeps/unix/sysv/linux/configure
@@ -20,7 +20,7 @@ else
 #include "confdefs.h"
 #include <linux/version.h>
 int main() {
-#if LINUX_VERSION_CODE <  ( *65536+ 0 *256+ 10) /* .0.10 */
+#if LINUX_VERSION_CODE <  (2 *65536+ 0 *256+ 10) /* 2.0.10 */
 eat flaming death
 #endif
 ; return 0; }
diff --git a/sysdeps/unix/sysv/linux/getdents.c b/sysdeps/unix/sysv/linux/getdents.c
index 0504393e67..40b31617ef 100644
--- a/sysdeps/unix/sysv/linux/getdents.c
+++ b/sysdeps/unix/sysv/linux/getdents.c
@@ -16,10 +16,12 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#include <alloca.h>
 #include <dirent.h>
 #include <stddef.h>
 #include <string.h>
 #include <unistd.h>
+#include <sys/param.h>
 #include <sys/types.h>
 
 #include <linux/posix_types.h>
@@ -52,8 +54,7 @@ struct kernel_dirent
    in the buffer.  Taking this number allows us to specify a correct
    number of bytes to read.  If we should be wrong, we can reset the
    file descriptor.  */
-int __getdirentries __P ((int fd, char *buf, size_t nbytes, off_t *basep));
-int
+ssize_t
 __getdirentries (fd, buf, nbytes, basep)
      int fd;
      char *buf;
@@ -62,32 +63,33 @@ __getdirentries (fd, buf, nbytes, basep)
 {
   off_t base = __lseek (fd, (off_t) 0, SEEK_CUR);
   size_t red_nbytes;
-  struct kernel_dirent *kdp;
+  struct kernel_dirent *skdp, *kdp;
   struct dirent *dp;
   int retval;
 
   red_nbytes = nbytes - (nbytes / (offsetof (struct dirent, d_name) + 3));
 
   dp = (struct dirent *) buf;
-  kdp = (struct kernel_dirent *) (buf + (nbytes - red_nbytes));
+  skdp = kdp = __alloca (red_nbytes);
 
   retval = __getdents (fd, (char *) kdp, red_nbytes);
 
-  while ((char *) kdp < buf + (nbytes - red_nbytes) + retval)
+  while ((char *) kdp < (char *) skdp + retval)
     {
+      const size_t size_diff = MAX (offsetof (struct dirent, d_name)
+				    - offsetof (struct kernel_dirent, d_name),
+				    __alignof__ (struct dirent));
       dp->d_ino = kdp->d_ino;
       dp->d_off = kdp->d_off;
-      dp->d_reclen = (kdp->d_reclen
-		      + (offsetof (struct dirent, d_name)
-			 - offsetof (struct kernel_dirent, d_name)));
+      dp->d_reclen = kdp->d_reclen + size_diff;
       dp->d_type = DT_UNKNOWN;
-      memmove (dp->d_name, kdp->d_name,
-	       kdp->d_reclen - offsetof (struct kernel_dirent, d_name));
+      memcpy (dp->d_name, kdp->d_name,
+	      kdp->d_reclen - offsetof (struct kernel_dirent, d_name));
 
       dp = (struct dirent *) (((char *) dp) + dp->d_reclen);
       kdp = (struct kernel_dirent *) (((char *) kdp) + kdp->d_reclen);
 
-      if ((char *) dp >= (char *) kdp)
+      if ((char *) dp >= buf + nbytes)
 	{
 	  /* Our heuristic failed.  We read too many entries.  Reset
 	     the stream.  */
@@ -99,7 +101,7 @@ __getdirentries (fd, buf, nbytes, basep)
   if (basep)
     *basep = base;
 
-  return (char *) dp - (char *) buf;
+  return (char *) dp - buf;
 }
 
 weak_alias (__getdirentries, getdirentries)
diff --git a/sysdeps/unix/sysv/linux/i386/Makefile b/sysdeps/unix/sysv/linux/i386/Makefile
index 77c9ad3e85..2ecedd4b15 100644
--- a/sysdeps/unix/sysv/linux/i386/Makefile
+++ b/sysdeps/unix/sysv/linux/i386/Makefile
@@ -1,4 +1,4 @@
-ifeq ($(subdir), misc)
+ifeq ($(subdir),misc)
 sysdep_routines += ioperm iopl vm86
 sysdep_headers += sys/perm.h sys/vm86.h
 endif
diff --git a/sysdeps/unix/sysv/linux/kernel_termios.h b/sysdeps/unix/sysv/linux/sys/kernel_termios.h
index 3b2653b2cd..95349760f0 100644
--- a/sysdeps/unix/sysv/linux/kernel_termios.h
+++ b/sysdeps/unix/sysv/linux/sys/kernel_termios.h
@@ -1,13 +1,13 @@
 /* The following corresponds to the values from the Linux 2.1.20 kernel.  */
 
-#define KERNEL_NCCS 19
+#define __KERNEL_NCCS 19
 
-struct kernel_termios
+struct __kernel_termios
   {
     tcflag_t c_iflag;		/* input mode flags */
     tcflag_t c_oflag;		/* output mode flags */
     tcflag_t c_cflag;		/* control mode flags */
     tcflag_t c_lflag;		/* local mode flags */
     cc_t c_line;		/* line discipline */
-    cc_t c_cc[KERNEL_NCCS];	/* control characters */
+    cc_t c_cc[__KERNEL_NCCS];	/* control characters */
   };
diff --git a/sysdeps/unix/sysv/linux/sys/procfs.h b/sysdeps/unix/sysv/linux/sys/procfs.h
index e8d32390fa..a1190a348f 100644
--- a/sysdeps/unix/sysv/linux/sys/procfs.h
+++ b/sysdeps/unix/sysv/linux/sys/procfs.h
@@ -94,7 +94,7 @@ struct elf_prpsinfo
     unsigned long int pr_flag;		/* Flags.  */
     unsigned short int pr_uid;
     unsigned short int pr_gid;
-    unsigned short int pr_pid, pr_ppid, pr_pgrp, pr_sid;
+    int pr_pid, pr_ppid, pr_pgrp, pr_sid;
     /* Lots missing */
     char pr_fname[16];			/* Filename of executable.  */
     char pr_psargs[ELF_PRARGSZ];	/* Initial part of arg list.  */
diff --git a/sysdeps/unix/sysv/linux/tcgetattr.c b/sysdeps/unix/sysv/linux/tcgetattr.c
index 2e8cb1cf79..9578c4b772 100644
--- a/sysdeps/unix/sysv/linux/tcgetattr.c
+++ b/sysdeps/unix/sysv/linux/tcgetattr.c
@@ -23,7 +23,7 @@
 /* The difference here is that the termios structure used in the
    kernel is not the same as we use in the libc.  Therefore we must
    translate it here.  */
-#include <kernel_termios.h>
+#include <sys/kernel_termios.h>
 
 /* Put the state of FD into *TERMIOS_P.  */
 int
@@ -31,7 +31,7 @@ __tcgetattr (fd, termios_p)
       int fd;
       struct termios *termios_p;
 {
-  struct kernel_termios k_termios;
+  struct __kernel_termios k_termios;
   int retval;
   size_t cnt;
 
@@ -48,7 +48,7 @@ __tcgetattr (fd, termios_p)
 #ifdef _HAVE_C_OSPEED
   termios_p->c_ospeed = k_termios.c_ospeed;
 #endif
-  for (cnt = 0; cnt < KERNEL_NCCS; ++cnt)
+  for (cnt = 0; cnt < __KERNEL_NCCS; ++cnt)
     termios_p->c_cc[cnt] = k_termios.c_cc[cnt];
 
   return retval;
diff --git a/sysdeps/unix/sysv/linux/tcsetattr.c b/sysdeps/unix/sysv/linux/tcsetattr.c
index 3bb3e9f5ec..6c128110f6 100644
--- a/sysdeps/unix/sysv/linux/tcsetattr.c
+++ b/sysdeps/unix/sysv/linux/tcsetattr.c
@@ -24,7 +24,7 @@
 /* The difference here is that the termios structure used in the
    kernel is not the same as we use in the libc.  Therefore we must
    translate it here.  */
-#include <kernel_termios.h>
+#include <sys/kernel_termios.h>
 
 
 /* Set the state of FD to *TERMIOS_P.  */
@@ -34,7 +34,7 @@ tcsetattr (fd, optional_actions, termios_p)
      int optional_actions;
      const struct termios *termios_p;
 {
-  struct kernel_termios k_termios;
+  struct __kernel_termios k_termios;
   unsigned long int cmd;
   size_t cnt;
 
@@ -65,7 +65,7 @@ tcsetattr (fd, optional_actions, termios_p)
 #ifdef _HAVE_C_OSPEED
   k_termios.c_ospeed = termios_p->c_ospeed;
 #endif
-  for (cnt = 0; cnt < KERNEL_NCCS; ++cnt)
+  for (cnt = 0; cnt < __KERNEL_NCCS; ++cnt)
     k_termios.c_cc[cnt] = termios_p->c_cc[cnt];
 
   return __ioctl (fd, cmd, &k_termios);
diff --git a/time/Banner b/time/Banner
deleted file mode 100644
index eb972db206..0000000000
--- a/time/Banner
+++ /dev/null
@@ -1 +0,0 @@
-tzcode1997a and tzdata1997a by Arthur David Olson et. al.
diff --git a/time/Makefile b/time/Makefile
index 21ad62e071..7f8513cc6a 100644
--- a/time/Makefile
+++ b/time/Makefile
@@ -24,7 +24,7 @@ subdir	:= time
 headers	:= time.h sys/time.h sys/timeb.h timebits.h
 distribute := tzfile.h private.h scheck.c ialloc.c yearistype	\
 	      iso3166.tab zone.tab tzselect.ksh checktab.awk	\
-	      Banner
+	      README
 extra-objs = scheck.o ialloc.o $(tzfiles:%=z.%)
 
 routines	:= offtime asctime clock ctime ctime_r difftime	\
@@ -65,22 +65,22 @@ endef
 
 # Make these absolute file names.
 installed-localtime-file := $(firstword $(filter /%,$(localtime-file)) \
-					$(addprefix $(zonedir)/, \
+					$(addprefix $(inst_zonedir)/, \
 						    $(localtime-file)))
 installed-posixrules-file := $(firstword $(filter /%,$(posixrules-file)) \
-					 $(addprefix $(zonedir)/, \
+					 $(addprefix $(inst_zonedir)/, \
 						     $(posixrules-file)))
 
 ifeq ($(cross-compiling),no)
 # Don't try to install the zoneinfo files since we can't run zic.
-install-others = $(addprefix $(zonedir)/,$(zonenames) \
-					 $(zonenames:%=posix/%) \
-					 $(zonenames:%=right/%)) \
+install-others = $(addprefix $(inst_zonedir)/,$(zonenames) \
+					      $(zonenames:%=posix/%) \
+					      $(zonenames:%=right/%)) \
 		 $(installed-localtime-file) $(installed-posixrules-file)
 endif
 
 ifeq ($(have-ksh),yes)
-install-others += $(zonedir)/iso3166.tab $(zonedir)/zone.tab
+install-others += $(inst_zonedir)/iso3166.tab $(inst_zonedir)/zone.tab
 install-bin += tzselect
 endif
 
@@ -115,23 +115,23 @@ echo-zonenames:
 	@echo 'Known zones: $(zonenames)'
 
 
-# Although $(zonedir) gets compiled into zic, it is useful to always
-# specify it with -d on the command line so that it can be overridden on
-# the command line of `make install' (e.g., "make install prefix=/foo").
-zic-cmd = $(built-program-cmd) -d $(zonedir)
+# We have to use `-d $(inst_zonedir)' to explictly tell zic where to
+# place the output files although $(zonedir) is compiled in.  But the
+# user might have set $(install_root) on the command line of `make install'.
+zic-cmd = $(built-program-cmd) -d $(inst_zonedir)
 tzcompile = $(zic-cmd)$(target-zone-flavor) -L $(word 3,$^) \
 	    -y $(dir $(word 4,$^))$(notdir $(word 4,$^)) $<
 
 # The source files specify the zone names relative to the -d directory,
-# so for the posix/ and right/ flavors we need to pass -d $(zonedir)/posix
+# so for the posix/ and right/ flavors we need to pass -d $(inst_zonedir)/posix
 # and the like.  This magic extracts /posix or /right if it's the first
-# component after $(zonedir) in the target name $@.
+# component after $(inst_zonedir) in the target name $@.
 target-zone-flavor = $(filter /posix /right, \
 			      /$(firstword $(subst /, , \
-					   $(patsubst $(zonedir)/%,%,$@))))
+					  $(patsubst $(inst_zonedir)/%,%,$@))))
 
 ifdef localtime
-$(installed-localtime-file): $(zonedir)/$(localtime) $(objpfx)zic
+$(installed-localtime-file): $(inst_zonedir)/$(localtime) $(objpfx)zic
 	$(make-target-directory)
 	if test -r $@; then \
 	  echo Site timezone NOT reset to Factory.; \
@@ -142,7 +142,7 @@ $(installed-localtime-file): $(zonedir)/$(localtime) $(objpfx)zic
 	fi
 endif
 ifdef posixrules
-$(installed-posixrules-file): $(zonedir)/$(posixrules) $(objpfx)zic
+$(installed-posixrules-file): $(inst_zonedir)/$(posixrules) $(objpfx)zic
 	$(zic-cmd) -p $(posixrules)
 endif
 
@@ -179,4 +179,5 @@ $(objpfx)tzselect: tzselect.ksh
 	chmod 555 $@.new
 	mv -f $@.new $@
 
-$(addprefix $(zonedir)/,iso3166.tab zone.tab): $(zonedir)/%: %; $(do-install)
+$(addprefix $(inst_zonedir)/,iso3166.tab zone.tab): $(inst_zonedir)/%: %
+	$(do-install)
diff --git a/time/README b/time/README
new file mode 100644
index 0000000000..3bd4e306ed
--- /dev/null
+++ b/time/README
@@ -0,0 +1,28 @@
+The sources files
+	`zic.c'
+	`zdump.c'
+	`tzselect.ksh'
+	`checktab.awk'
+files come from the tzcode1997a package by Arthur David Olsen et.al.
+
+The file
+	`africa'
+	`antarctica'
+	`asia'
+	`australasia'
+	`europe'
+	`northamerica'
+	`southamerica'
+	`pacificnew'
+	`etcetera'
+	`factory'
+	`backward'
+	`systemv'
+	`solar87'
+	`solar88'
+	`solar89'
+	`iso3166.tab'
+	`zone.tab'
+	`leapseconds'
+	`yearistype'
+files come from the tzdata1997a package by Arthur David Olsen et.al.
diff --git a/time/strftime.c b/time/strftime.c
index 56abd45240..ca3563c072 100644
--- a/time/strftime.c
+++ b/time/strftime.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 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
@@ -328,6 +328,31 @@ static char const month_name[][10] =
   };
 #endif
 
+
+#if !defined _LIBC && HAVE_TZNAME && HAVE_TZSET
+  /* Solaris 2.5 tzset sometimes modifies the storage returned by localtime.
+     Work around this bug by copying *tp before it might be munged.  */
+  size_t _strftime_copytm __P ((char *, size_t, const char *,
+			        const struct tm *));
+  size_t
+  strftime (s, maxsize, format, tp)
+      char *s;
+      size_t maxsize;
+      const char *format;
+      const struct tm *tp;
+  {
+    struct tm tmcopy;
+    tmcopy = *tp;
+    return _strftime_copytm (s, maxsize, format, &tmcopy);
+  }
+# ifdef strftime
+#  undef strftime
+# endif
+# define strftime(S, Maxsize, Format, Tp) \
+  _strftime_copytm ((S), (Maxsize), (Format), (Tp))
+#endif
+
+
 /* Write information from TP into S according to the format
    string FORMAT, writing no more that MAXSIZE characters
    (including the terminating '\0') and returning number of