summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-11-30 14:21:53 +0000
committerUlrich Drepper <drepper@redhat.com>1998-11-30 14:21:53 +0000
commit348ed5157bb4b6ef0e38f18ab8fd8d9910544e6e (patch)
tree8292846db47f486376760bcbf5f3dc6ef9a260a9
parent3f7b3d9b1f5fe48edeaa532355a7fb04a1836fa2 (diff)
downloadglibc-348ed5157bb4b6ef0e38f18ab8fd8d9910544e6e.tar.gz
glibc-348ed5157bb4b6ef0e38f18ab8fd8d9910544e6e.tar.xz
glibc-348ed5157bb4b6ef0e38f18ab8fd8d9910544e6e.zip
Update.
1998-11-30  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

	* nscd/nscd_getpw_r.c: Include nscd_proto.h for prototypes.

	* sysdeps/generic/errno-loc.c: Include <errno.h> for prototype,
	undefine errno to get variable.

	* sysdeps/unix/sysv/linux/i386/setfsuid.c: Include <sys/fsuid.h>
	instead of <unistd.h> for prototype.
	* sysdeps/unix/sysv/linux/i386/setfsgid.c: Likewise.

1998-11-30  Ulrich Drepper  <drepper@cygnus.com>

	* misc/err.h: Correct comments and use protected attribute keywords.
	Reported by Joseph Myers <jsm28@cam.ac.uk>.

1998-11-29  Roland McGrath  <roland@baalperazim.frob.com>

	* malloc/thread-m.h [_LIBC]: Include <bits/libc-tsd.h>, and
	remove tsd stuff from pthreads/cthreads libc sections.
	Use __libc_tsd_define for MALLOC key.
	[_LIBC] (tsd_key_t, tsd_key_create): Define to a zero-size type and a
	no-op, respectively.
	[_LIBC] (tsd_setspecific, tsd_getspecific): Use __libc_tsd_get/set.

	* elf/dl-error.c: Include <bits/libc-tsd.h>.
	Use __libc_tsd_define for DL_ERROR key.
	(tsd_setspecific, tsd_getspecific): Rewritten using __libc_tsd_get/set.

	* sysdeps/mach/hurd/bits/libc-tsd.h: New file.
	* sysdeps/generic/bits/libc-tsd.h: New file.
	* Makefile (distribute): Add bits/libc-tsd.h.

1998-10-12  Roland McGrath  <roland@baalperazim.frob.com>

	* elf/dl-error.c: Remove kludge to check for ld.so load address.
	There is no need if weak undefined symbols are not used in ld.so;
	see linuxthreads/ChangeLog for changes to files
	linuxthreads/sysdeps/pthread/bits/libc-lock.h and
	linuxthreads/sysdeps/pthread/bits/libc-tsd.h.

1998-11-30  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

	* sysdeps/i386/bits/string.h (__memset_cc): Fix typo (s->__s).

	* sysdeps/i386/i486/bits/string.h: Add prototypes for all new
	inline functions.
	* sysdeps/i386/bits/string.h: Likewise.

1998-11-30  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

	* sysdeps/unix/sysv/linux/alpha/bits/ipc.h: Remove ipc_kludge.

1998-11-30  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>

	* db2/progs/db_load/db_load.c (main): Avoid -Wparentheses warning.
-rw-r--r--ChangeLog57
-rw-r--r--FAQ95
-rw-r--r--bits/libc-tsd.h51
-rw-r--r--db2/progs/db_load/db_load.c4
-rw-r--r--elf/dl-error.c45
-rw-r--r--linuxthreads/ChangeLog22
-rw-r--r--linuxthreads/Makefile2
-rw-r--r--linuxthreads/internals.h2
-rw-r--r--linuxthreads/no-tsd.c33
-rw-r--r--linuxthreads/specific.c10
-rw-r--r--linuxthreads/sysdeps/pthread/bits/libc-lock.h17
-rw-r--r--linuxthreads/sysdeps/pthread/bits/libc-tsd.h43
-rw-r--r--malloc/thread-m.h38
-rw-r--r--misc/err.h23
-rw-r--r--nscd/nscd_getpw_r.c1
-rw-r--r--sysdeps/generic/bits/libc-tsd.h51
-rw-r--r--sysdeps/generic/errno-loc.c5
-rw-r--r--sysdeps/i386/bits/string.h16
-rw-r--r--sysdeps/i386/i486/bits/string.h99
-rw-r--r--sysdeps/mach/hurd/bits/libc-tsd.h37
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/ipc.h9
-rw-r--r--sysdeps/unix/sysv/linux/i386/setfsgid.c2
-rw-r--r--sysdeps/unix/sysv/linux/i386/setfsuid.c2
23 files changed, 524 insertions, 140 deletions
diff --git a/ChangeLog b/ChangeLog
index 47c812fd7e..180ccd4347 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,60 @@
+1998-11-30  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
+
+	* nscd/nscd_getpw_r.c: Include nscd_proto.h for prototypes.
+
+	* sysdeps/generic/errno-loc.c: Include <errno.h> for prototype,
+	undefine errno to get variable.
+
+	* sysdeps/unix/sysv/linux/i386/setfsuid.c: Include <sys/fsuid.h>
+	instead of <unistd.h> for prototype.
+	* sysdeps/unix/sysv/linux/i386/setfsgid.c: Likewise.
+
+1998-11-30  Ulrich Drepper  <drepper@cygnus.com>
+
+	* misc/err.h: Correct comments and use protected attribute keywords.
+	Reported by Joseph Myers <jsm28@cam.ac.uk>.
+
+1998-11-29  Roland McGrath  <roland@baalperazim.frob.com>
+
+	* malloc/thread-m.h [_LIBC]: Include <bits/libc-tsd.h>, and
+	remove tsd stuff from pthreads/cthreads libc sections.
+	Use __libc_tsd_define for MALLOC key.
+	[_LIBC] (tsd_key_t, tsd_key_create): Define to a zero-size type and a
+	no-op, respectively.
+	[_LIBC] (tsd_setspecific, tsd_getspecific): Use __libc_tsd_get/set.
+
+	* elf/dl-error.c: Include <bits/libc-tsd.h>.
+	Use __libc_tsd_define for DL_ERROR key.
+	(tsd_setspecific, tsd_getspecific): Rewritten using __libc_tsd_get/set.
+
+	* sysdeps/mach/hurd/bits/libc-tsd.h: New file.
+	* sysdeps/generic/bits/libc-tsd.h: New file.
+	* Makefile (distribute): Add bits/libc-tsd.h.
+
+1998-10-12  Roland McGrath  <roland@baalperazim.frob.com>
+
+	* elf/dl-error.c: Remove kludge to check for ld.so load address.
+	There is no need if weak undefined symbols are not used in ld.so;
+	see linuxthreads/ChangeLog for changes to files
+	linuxthreads/sysdeps/pthread/bits/libc-lock.h and
+	linuxthreads/sysdeps/pthread/bits/libc-tsd.h.
+
+1998-11-30  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
+
+	* sysdeps/i386/bits/string.h (__memset_cc): Fix typo (s->__s).
+
+	* sysdeps/i386/i486/bits/string.h: Add prototypes for all new
+	inline functions.
+	* sysdeps/i386/bits/string.h: Likewise.
+
+1998-11-30  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
+
+	* sysdeps/unix/sysv/linux/alpha/bits/ipc.h: Remove ipc_kludge.
+
+1998-11-30  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
+
+	* db2/progs/db_load/db_load.c (main): Avoid -Wparentheses warning.
+
 1998-09-12  Mark Kettenis  <kettenis@phys.uva.nl>
 
 	* sysdeps/mach/hurd/dl-sysdep.c: Do not define
diff --git a/FAQ b/FAQ
index a3d3b5a152..e88fb734b6 100644
--- a/FAQ
+++ b/FAQ
@@ -24,22 +24,23 @@ please let me know.
 	What's wrong?
 1.4.	Do I need a special linker or assembler?
 1.5.	Which compiler should I use for powerpc?
-1.6.	Do I need some more things to compile the GNU C Library?
-1.7.	What version of the Linux kernel headers should be used?
-1.8.	The compiler hangs while building iconvdata modules.  What's
+1.6.	Which tools should I use for ARM?
+1.7.	Do I need some more things to compile the GNU C Library?
+1.8.	What version of the Linux kernel headers should be used?
+1.9.	The compiler hangs while building iconvdata modules.  What's
 	wrong?
-1.9.	When I run `nm -u libc.so' on the produced library I still
+1.10.	When I run `nm -u libc.so' on the produced library I still
 	find unresolved symbols.  Can this be ok?
-1.10.	What are these `add-ons'?
-1.11.	My XXX kernel emulates a floating-point coprocessor for me.
+1.11.	What are these `add-ons'?
+1.12.	My XXX kernel emulates a floating-point coprocessor for me.
 	Should I enable --with-fp?
-1.12.	When compiling GNU libc I get lots of errors saying functions
+1.13.	When compiling GNU libc I get lots of errors saying functions
 	in glibc are duplicated in libgcc.
-1.13.	Why do I get messages about missing thread functions when I use
+1.14.	Why do I get messages about missing thread functions when I use
 	librt?  I don't even use threads.
-1.14.	What's the problem with configure --enable-omitfp?
-1.15.	I get failures during `make check'.  What shall I do?
-1.16.	What is symbol versioning good for?  Do I need it?
+1.15.	What's the problem with configure --enable-omitfp?
+1.16.	I get failures during `make check'.  What shall I do?
+1.17.	What is symbol versioning good for?  Do I need it?
 
 2. Installation and configuration issues
 
@@ -140,6 +141,8 @@ please let me know.
 	to EST5EDT things go wrong since glibc computes the wrong time
 	from this information.
 4.4.	What other sources of documentation about glibc are available?
+4.5.	The timezone string for Sydney/Australia is wrong since even when
+	daylight saving time is in effect the timezone string is EST.
 
 
 ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 
@@ -163,6 +166,7 @@ in the future, are:
 	sparc-*-linux-gnu	Linux-2.x on SPARC
 	sparc64-*-linux-gnu	Linux-2.x on UltraSPARC
 	arm-*-none		ARM standalone systems
+	arm-*-linux		Linux-2.x on ARM
 	arm-*-linuxaout		Linux-2.x on ARM using a.out binaries
 
 Ports to other Linux platforms are in development, and may in fact work
@@ -191,7 +195,7 @@ a local mirror first.
 You should always try to use the latest official release.  Older versions
 may not have all the features GNU libc requires.  The current releases of
 egcs (1.0.3 and 1.1) and GNU CC (2.8.1) should work with the GNU C library
-(for powerpc see question question 1.5).
+(for powerpc see question question 1.5; for ARM see question question 1.6).
 
 {ZW} You may have problems if you try to mix code compiled with
 EGCS and with GCC 2.8.1. See question 2.8 for details.
@@ -240,7 +244,18 @@ variables.  There is a temporary patch at:
 Later versions of egcs may fix this problem.
 
 
-1.6.	Do I need some more things to compile the GNU C Library?
+1.6.	Which tools should I use for ARM?
+
+{PB} You should use egcs 1.1 or a later version.  For ELF systems some
+changes are needed to the compiler; a patch against egcs-1.1.x can be found
+at:
+
+<ftp://ftp.netwinder.org/users/p/philb/egcs-1.1.1pre2-diff-981126>
+
+Binutils 2.9.1.0.16 or later is also required.
+
+
+1.7.	Do I need some more things to compile the GNU C Library?
 
 {UD} Yes, there are some more :-).
 
@@ -284,7 +299,7 @@ Later versions of egcs may fix this problem.
   If you have some more measurements let me know.
 
 
-1.7.	What version of the Linux kernel headers should be used?
+1.8.	What version of the Linux kernel headers should be used?
 
 {AJ,UD} The headers from the most recent Linux kernel should be used.  The
 headers used while compiling the GNU C library and the kernel binary used
@@ -307,7 +322,7 @@ kernel sources to the 2.1 tree, do `make oldconfig', and say no to all the
 new options.
 
 
-1.8.	The compiler hangs while building iconvdata modules.  What's
+1.9.	The compiler hangs while building iconvdata modules.  What's
 	wrong?
 
 {ZW} This is a problem with old versions of GCC.  Initialization of large
@@ -317,7 +332,7 @@ time.
 The problem is fixed in egcs 1.1 but not in earlier releases.
 
 
-1.9.	When I run `nm -u libc.so' on the produced library I still
+1.10.	When I run `nm -u libc.so' on the produced library I still
 	find unresolved symbols.  Can this be ok?
 
 {UD} Yes, this is ok.  There can be several kinds of unresolved symbols:
@@ -333,7 +348,7 @@ Generally, you should make sure you find a real program which produces
 errors while linking before deciding there is a problem.
 
 
-1.10.	What are these `add-ons'?
+1.11.	What are these `add-ons'?
 
 {UD} To avoid complications with export rules or external source code some
 optional parts of the libc are distributed as separate packages (e.g., the
@@ -356,7 +371,7 @@ else.  The existing makefiles do most of the work; only some few stub rules
 must be written to get everything running.
 
 
-1.11.	My XXX kernel emulates a floating-point coprocessor for me.
+1.12.	My XXX kernel emulates a floating-point coprocessor for me.
 	Should I enable --with-fp?
 
 {ZW} An emulated FPU is just as good as a real one, as far as the C library
@@ -370,7 +385,7 @@ far more trouble than it's worth: you then have to compile
 (libgcc.a for GNU C), because the calling conventions change.
 
 
-1.12.	When compiling GNU libc I get lots of errors saying functions
+1.13.	When compiling GNU libc I get lots of errors saying functions
 	in glibc are duplicated in libgcc.
 
 {EY} This is *exactly* the same problem that I was having.  The problem was
@@ -387,7 +402,7 @@ problems of this kind.  The setting of CFLAGS is checked at the very
 beginning and if it is not usable `configure' will bark.
 
 
-1.13.	Why do I get messages about missing thread functions when I use
+1.14.	Why do I get messages about missing thread functions when I use
 	librt?  I don't even use threads.
 
 {UD} In this case you probably mixed up your installation.  librt uses
@@ -403,7 +418,7 @@ given path to find the implicitly referenced library while not disturbing
 any other link path.
 
 
-1.14.	What's the problem with configure --enable-omitfp?
+1.15.	What's the problem with configure --enable-omitfp?
 
 {AJ} When --enable-omitfp is set the libraries are built without frame
 pointers.  Some compilers produce buggy code for this model and therefore we
@@ -422,7 +437,7 @@ The compilation of these extra libraries and the compiler optimizations slow
 down the build process and need more disk space.
 
 
-1.15.	I get failures during `make check'.  What shall I do?
+1.16.	I get failures during `make check'.  What shall I do?
 
 {AJ} The testsuite should compile and run cleanly on your system, every
 failure should be looked into.  Depending on the failure I wouldn't advise
@@ -445,7 +460,7 @@ There are some failures which are not directly related to the GNU libc:
   development kernels have fixes for the floating point support on Alpha.
 
 
-1.16.	What is symbol versioning good for?  Do I need it?
+1.17.	What is symbol versioning good for?  Do I need it?
 
 {AJ} Symbol versioning solves problems that are related to interface
 changes.  One version of an interface might have been introduced in a
@@ -565,7 +580,7 @@ question 3.8 for details.
 source code.  Until this law gets abolished we cannot ship the cryptographic
 functions together with glibc.
 
-The functions are available, as an add-on (see question 1.10).  People in the US
+The functions are available, as an add-on (see question 1.11).  People in the US
 may get it from the same place they got GNU libc from.  People outside the
 US should get the code from ftp://ftp.ifi.uio.no/pub/gnu, or another archive
 site outside the USA.  The README explains how to install the sources.
@@ -1333,9 +1348,20 @@ from your favorite mirror of ftp.gnu.org.
 where the headers are stable.  There are still lots of incompatible changes
 made and the libc headers have to follow.
 
-Also, make sure you have a suitably recent kernel.  As of the 970401
-snapshot, according to Philip Blundell <Philip.Blundell@pobox.com>, the
-required kernel version is at least 2.1.30.
+{PB} The 2.1 release of GNU libc aims to comply with the current versions of
+all the relevant standards.  The IPv6 support libraries for older Linux
+systems used a different naming convention and so code written to work with
+them may need to be modified.  If the standards make incompatible changes in
+the future then the libc may need to change again.
+
+IPv6 will not work with a 2.0.x kernel.  When kernel 2.2 is released it
+should contain all the necessary support; until then you should use the
+latest 2.1.x release you can find.  As of 98/11/26 the currently recommended
+kernel for IPv6 is 2.1.129.
+
+Also, as of the 2.1 release the IPv6 API provided by GNU libc is not
+100% complete.  In particular the getipnodebyname and getipnodebyaddr
+functions are not implemented.
 
 
 4.3.	When I set the timezone by setting the TZ environment variable
@@ -1375,6 +1401,21 @@ Looijaard describes a different way installing glibc2 as secondary libc at
 
 Please note that this is not a complete list.
 
+
+4.5.	The timezone string for Sydney/Australia is wrong since even when
+	daylight saving time is in effect the timezone string is EST.
+
+{UD} The problem for some timezones is that the local authorities decided
+to use the term "summer time" instead of "daylight saving time".  In this
+case the abbreviation character `S' is the same as the standard one.  So,
+for Sydney we have
+
+	Eastern Standard Time	= EST
+	Eastern Summer Time	= EST
+
+Great!  To get this bug fixed convince the authorities to change the laws
+and regulations of the country this effects.  glibc behaves correctly.
+
 
 ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 
 
diff --git a/bits/libc-tsd.h b/bits/libc-tsd.h
new file mode 100644
index 0000000000..6048d995c8
--- /dev/null
+++ b/bits/libc-tsd.h
@@ -0,0 +1,51 @@
+/* libc-internal interface for thread-specific data.  Stub version.
+   Copyright (C) 1998 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 _BITS_LIBC_TSD_H
+#define _BITS_LIBC_TSD_H 1
+
+/* This file defines the following macros for accessing a small fixed
+   set of thread-specific `void *' data used only internally by libc.
+
+   __libc_tsd_define(CLASS, KEY)	-- Define or declare a `void *' datum
+   					   for KEY.  CLASS can be `static' for
+					   keys used in only one source file,
+					   empty for global definitions, or
+					   `extern' for global declarations.
+   __libc_tsd_get(KEY)			-- Return the `void *' datum for KEY.
+   __libc_tsd_set(KEY, VALUE)		-- Set the datum for KEY to VALUE.
+
+   The set of available KEY's will usually be provided as an enum,
+   and contains (at least):
+		_LIBC_TSD_KEY_MALLOC
+		_LIBC_TSD_KEY_DL_ERROR
+   All uses must be the literal _LIBC_TSD_* name in the __libc_tsd_* macros.
+   Some implementations may not provide any enum at all and instead
+   using string pasting in the macros.  */
+
+/* This is the generic/stub implementation for wholly single-threaded
+   systems.  We don't define an enum for the possible key values, because
+   the KEYs translate directly into variables by macro magic.  */
+
+#define __libc_tsd_define(CLASS, KEY)	CLASS void *__libc_tsd_##KEY##_data;
+#define __libc_tsd_get(KEY)		(__libc_tsd_##KEY##_data)
+#define __libc_tsd_set(KEY, VALUE)	(__libc_tsd_##KEY##_data = (VALUE))
+
+
+#endif	/* bits/libc-tsd.h */
diff --git a/db2/progs/db_load/db_load.c b/db2/progs/db_load/db_load.c
index 5ac17753f5..84cfb36775 100644
--- a/db2/progs/db_load/db_load.c
+++ b/db2/progs/db_load/db_load.c
@@ -161,7 +161,7 @@ main(argc, argv)
 
 	/* Get each key/data pair and add them to the database. */
 	for (recno = 1;; ++recno) {
-		if (dbtype == DB_RECNO)
+		if (dbtype == DB_RECNO) {
 			if (checkprint) {
 				if (dbt_rprint(&data))
 					break;
@@ -169,7 +169,7 @@ main(argc, argv)
 				if (dbt_rdump(&data))
 					break;
 			}
-		else
+		} else
 			if (checkprint) {
 				if (dbt_rprint(&key))
 					break;
diff --git a/elf/dl-error.c b/elf/dl-error.c
index ae63447453..9ccc193a66 100644
--- a/elf/dl-error.c
+++ b/elf/dl-error.c
@@ -22,7 +22,7 @@
 #include <string.h>
 #include <unistd.h>
 #include <elf/ldsodefs.h>
-#include <bits/libc-lock.h>
+#include <bits/libc-tsd.h>
 
 /* This structure communicates state between _dl_catch_error and
    _dl_signal_error.  */
@@ -36,44 +36,11 @@ struct catch
    calls can come from `_dl_map_object_deps', `_dlerror_run', or from
    any of the libc functionality which loads dynamic objects (NSS, iconv).
    Therefore we have to be prepared to save the state in thread-local
-   memory.  `catch' will only be used for the non-threaded case.
-
-   Please note the horrible kludge we have to use to check for the
-   thread functions to be defined.  The problem is that while running
-   ld.so standalone (i.e., before the relocation with the available
-   libc symbols) we do not have a real handling of undefined weak symbols.
-   All symbols are relocated, regardless of the availability.  They are
-   relocated relative to the load address of the dynamic linker.  Adding
-   this start address to zero (the value in the GOT for undefined symbols)
-   leads to an address which is the load address of ld.so.  Once we have
-   relocated with the libc values the value is NULL if the function is
-   not available.  Our "solution" is to regard NULL and the ld.so load
-   address as indicators for unavailable weak symbols.   */
-static struct catch *catch;
-
-#ifdef PIC
-# define tsd_setspecific(data) \
-  if (__libc_internal_tsd_set != (void *) _dl_rtld_map.l_addr		      \
-      && __libc_internal_tsd_set != NULL)				      \
-    __libc_internal_tsd_set (_LIBC_TSD_KEY_DL_ERROR, data);		      \
-  else									      \
-    catch = (data)
-# define tsd_getspecific() \
-  (__libc_internal_tsd_set != (void *) _dl_rtld_map.l_addr		      \
-   && __libc_internal_tsd_set != NULL					      \
-   ? (struct catch *) __libc_internal_tsd_get (_LIBC_TSD_KEY_DL_ERROR)	      \
-   : catch)
-#else
-# define tsd_setspecific(data) \
-  if (__libc_internal_tsd_set != NULL)					      \
-    __libc_internal_tsd_set (_LIBC_TSD_KEY_DL_ERROR, data);		      \
-  else									      \
-    catch = (data)
-# define tsd_getspecific() \
-  (__libc_internal_tsd_set != NULL					      \
-   ? (struct catch *) __libc_internal_tsd_get (_LIBC_TSD_KEY_DL_ERROR)	      \
-   : catch)
-#endif
+   memory.  */
+
+__libc_tsd_define (static, DL_ERROR)
+#define tsd_getspecific()	__libc_tsd_get (DL_ERROR)
+#define tsd_setspecific(data)	__libc_tsd_set (DL_ERROR, (data))
 
 
 /* This points to a function which is called when an error is
diff --git a/linuxthreads/ChangeLog b/linuxthreads/ChangeLog
index 34486668bd..32b0159701 100644
--- a/linuxthreads/ChangeLog
+++ b/linuxthreads/ChangeLog
@@ -1,3 +1,25 @@
+1998-11-29  Roland McGrath  <roland@baalperazim.frob.com>
+
+	* sysdeps/pthread/bits/libc-tsd.h (__libc_tsd_define, __libc_tsd_get,
+	__libc_tsd_set): New macros for new interface.
+	* no-tsd.c: New file, provide uninitialized defns of
+	__libc_internal_tsd_get and __libc_internal_tsd_set.
+	* Makefile (routines): Add no-tsd.
+
+1998-10-12  Roland McGrath  <roland@baalperazim.frob.com>
+
+	* internals.h: Include <bits/libc-tsd.h>, not <bits/libc-lock.h>.
+	* sysdeps/pthread/bits/libc-lock.h (__libc_internal_tsd_get,
+	__libc_internal_tsd_set): Move decls to ...
+	* sysdeps/pthread/bits/libc-tsd.h: New file for __libc_internal_tsd_*
+	declarations.
+
+	* sysdeps/pthread/bits/libc-lock.h (__libc_internal_tsd_get,
+	__libc_internal_tsd_set): Make these pointers to functions, not
+	functions; remove #pragma weak decls for them.
+	* specific.c (__libc_internal_tsd_get, __libc_internal_tsd_set):
+	Define static functions and initialized pointers to them.
+
 1998-11-18  Ulrich Drepper  <drepper@cygnus.com>
 
 	* Makefile (CFLAGS-mutex.c): Define as -D__NO_WEAK_PTHREAD_ALIASES.
diff --git a/linuxthreads/Makefile b/linuxthreads/Makefile
index aad7106f4c..c19145fc00 100644
--- a/linuxthreads/Makefile
+++ b/linuxthreads/Makefile
@@ -27,7 +27,7 @@ linuxthreads-version := $(shell sed -n 's/^.*$(subdir)-\([0-9.]*\).*$$/\1/p' \
 headers := pthread.h semaphore.h bits/semaphore.h
 distribute := internals.h queue.h restart.h spinlock.h
 
-routines := weaks
+routines := weaks no-tsd
 
 extra-libs := libpthread
 extra-libs-others := $(extra-libs)
diff --git a/linuxthreads/internals.h b/linuxthreads/internals.h
index d11cf8471a..9765402dd1 100644
--- a/linuxthreads/internals.h
+++ b/linuxthreads/internals.h
@@ -16,7 +16,7 @@
 
 /* Includes */
 
-#include <bits/libc-lock.h> /* for _LIBC_TSD_KEY_N */
+#include <bits/libc-tsd.h> /* for _LIBC_TSD_KEY_N */
 #include <limits.h>
 #include <setjmp.h>
 #include <signal.h>
diff --git a/linuxthreads/no-tsd.c b/linuxthreads/no-tsd.c
new file mode 100644
index 0000000000..ef79cb8320
--- /dev/null
+++ b/linuxthreads/no-tsd.c
@@ -0,0 +1,33 @@
+/* libc-internal interface for thread-specific data.
+   Copyright (C) 1998 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 <bits/libc-tsd.h>
+
+/* This file provides uinitialized (common) definitions for the
+   hooks used internally by libc to access thread-specific data.
+
+   When -lpthread is used, it provides initialized definitions for these
+   variables (in specific.c), which override these uninitialized definitions.
+
+   If -lpthread is not used, these uninitialized variables default to zero,
+   which the __libc_tsd_* macros check for.   */
+
+void *(*__libc_internal_tsd_get) __P ((enum __libc_tsd_key_t));
+int (*__libc_internal_tsd_set) __P ((enum __libc_tsd_key_t,
+				     __const void *));
diff --git a/linuxthreads/specific.c b/linuxthreads/specific.c
index a86b1a0cec..674353dd39 100644
--- a/linuxthreads/specific.c
+++ b/linuxthreads/specific.c
@@ -161,17 +161,23 @@ void __pthread_destroy_specifics()
 
 /* Thread-specific data for libc. */
 
-int __libc_internal_tsd_set(enum __libc_tsd_key_t key, const void * pointer)
+static int
+libc_internal_tsd_set(enum __libc_tsd_key_t key, const void * pointer)
 {
   pthread_descr self = thread_self();
 
   THREAD_SETMEM_NC(self, p_libc_specific[key], (void *) pointer);
   return 0;
 }
+int (*__libc_internal_tsd_set)(enum __libc_tsd_key_t key, const void * pointer)
+     = libc_internal_tsd_set;
 
-void * __libc_internal_tsd_get(enum __libc_tsd_key_t key)
+static void *
+libc_internal_tsd_get(enum __libc_tsd_key_t key)
 {
   pthread_descr self = thread_self();
 
   return THREAD_GETMEM_NC(self, p_libc_specific[key]);
 }
+void * (*__libc_internal_tsd_get)(enum __libc_tsd_key_t key)
+     = libc_internal_tsd_get;
diff --git a/linuxthreads/sysdeps/pthread/bits/libc-lock.h b/linuxthreads/sysdeps/pthread/bits/libc-lock.h
index 1763a42cda..593117073c 100644
--- a/linuxthreads/sysdeps/pthread/bits/libc-lock.h
+++ b/linuxthreads/sysdeps/pthread/bits/libc-lock.h
@@ -149,19 +149,6 @@ typedef pthread_key_t __libc_key_t;
 #define __libc_setspecific(KEY, VALUE) \
   (__pthread_setspecific != NULL ? __pthread_setspecific (KEY, VALUE) : 0)
 
-#ifdef _LIBC
-
-/* Fast thread-specific data internal to libc.  */
-enum __libc_tsd_key_t { _LIBC_TSD_KEY_MALLOC = 0,
-			_LIBC_TSD_KEY_DL_ERROR,
-			_LIBC_TSD_KEY_N };
-
-extern void *__libc_internal_tsd_get __P ((enum __libc_tsd_key_t));
-extern int __libc_internal_tsd_set __P ((enum __libc_tsd_key_t,
-					 __const void *));
-
-#endif
-
 
 /* Register handlers to execute before and after `fork'.  */
 #define __libc_atfork(PREPARE, PARENT, CHILD) \
@@ -183,8 +170,6 @@ weak_extern (__pthread_mutexattr_settype)
 weak_extern (__pthread_key_create)
 weak_extern (__pthread_setspecific)
 weak_extern (__pthread_getspecific)
-weak_extern (__libc_internal_tsd_get)
-weak_extern (__libc_internal_tsd_set)
 weak_extern (__pthread_once)
 weak_extern (__pthread_initialize)
 weak_extern (__pthread_atfork)
@@ -202,8 +187,6 @@ weak_extern (_pthread_cleanup_pop_restore)
 #  pragma weak __pthread_key_create
 #  pragma weak __pthread_setspecific
 #  pragma weak __pthread_getspecific
-#  pragma weak __libc_internal_tsd_get
-#  pragma weak __libc_internal_tsd_set
 #  pragma weak __pthread_once
 #  pragma weak __pthread_initialize
 #  pragma weak __pthread_atfork
diff --git a/linuxthreads/sysdeps/pthread/bits/libc-tsd.h b/linuxthreads/sysdeps/pthread/bits/libc-tsd.h
new file mode 100644
index 0000000000..42a8b802c9
--- /dev/null
+++ b/linuxthreads/sysdeps/pthread/bits/libc-tsd.h
@@ -0,0 +1,43 @@
+/* libc-internal interface for thread-specific data.  LinuxThreads version.
+   Copyright (C) 1997, 1998 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 _BITS_LIBC_TSD_H
+#define _BITS_LIBC_TSD_H 1
+
+
+/* Fast thread-specific data internal to libc.  */
+enum __libc_tsd_key_t { _LIBC_TSD_KEY_MALLOC = 0,
+			_LIBC_TSD_KEY_DL_ERROR,
+			_LIBC_TSD_KEY_N };
+
+extern void *(*__libc_internal_tsd_get) __P ((enum __libc_tsd_key_t));
+extern int (*__libc_internal_tsd_set) __P ((enum __libc_tsd_key_t,
+					    __const void *));
+
+#define __libc_tsd_define(CLASS, KEY)	CLASS void *__libc_tsd_##KEY##_data;
+#define __libc_tsd_get(KEY) \
+  (__libc_internal_tsd_get != NULL \
+   ? __libc_internal_tsd_get (_LIBC_TSD_KEY_##KEY) \
+   : __libc_tsd_##KEY##_data)
+#define __libc_tsd_set(KEY, VALUE) \
+  (__libc_internal_tsd_set != NULL \
+   ? __libc_internal_tsd_set (_LIBC_TSD_KEY_##KEY, (VALUE)) \
+   : ((__libc_tsd_##KEY##_data = (VALUE)), 0))
+
+#endif	/* bits/libc-tsd.h */
diff --git a/malloc/thread-m.h b/malloc/thread-m.h
index d9e17397ce..bb9cba599e 100644
--- a/malloc/thread-m.h
+++ b/malloc/thread-m.h
@@ -40,20 +40,8 @@ typedef pthread_t thread_id;
 /* mutex */
 typedef pthread_mutex_t	mutex_t;
 
-/* thread specific data */
-typedef void * tsd_key_t;
-
 #define MUTEX_INITIALIZER	PTHREAD_MUTEX_INITIALIZER
 
-#define tsd_key_create(key, destr) ( *(key) = NULL )
-#define tsd_setspecific(key, 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 = (__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)
 #define mutex_lock(m)		\
@@ -85,20 +73,6 @@ typedef void * tsd_key_t;
 
 #define mutex_trylock(m) (!__mutex_trylock(m))
 
-#include <hurd/threadvar.h>
-
-/* thread specific data */
-typedef int tsd_key_t;
-
-static int tsd_keys_alloced = 0;
-
-#define tsd_key_create(key, destr) \
-  (assert (tsd_keys_alloced == 0), tsd_keys_alloced++)
-#define tsd_setspecific(key, data) \
-  (*__hurd_threadvar_location (_HURD_THREADVAR_MALLOC) = (unsigned long)(data))
-#define tsd_getspecific(key, vptr) \
-  ((vptr) = (void *)*__hurd_threadvar_location (_HURD_THREADVAR_MALLOC))
-
 #define thread_atfork(prepare, parent, child) do {} while(0)
 #define thread_atfork_static(prepare, parent, child) \
  text_set_element(_hurd_fork_prepare_hook, prepare); \
@@ -114,6 +88,18 @@ static int tsd_keys_alloced = 0;
 
 #endif /* MUTEX_INITIALIZER && PTHREAD_MUTEX_INITIALIZER */
 
+
+/* thread specific data */
+
+#include <bits/libc-tsd.h>
+
+typedef int tsd_key_t[0];	/* no key data structure, libc magic does it */
+__libc_tsd_define (, MALLOC)	/* declaration/common definition */
+#define tsd_key_create(key, destr)	((void) (key))
+#define tsd_setspecific(key, data)	__libc_tsd_set (MALLOC, (data))
+#define tsd_getspecific(key, vptr)	((vptr) = __libc_tsd_get (MALLOC))
+
+
 #elif defined(USE_PTHREADS) /* Posix threads */
 
 #include <pthread.h>
diff --git a/misc/err.h b/misc/err.h
index 643e96f2f5..6170006b85 100644
--- a/misc/err.h
+++ b/misc/err.h
@@ -1,5 +1,5 @@
 /* 4.4BSD utility functions for error messages.
-   Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996, 1997, 1998 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
@@ -30,27 +30,28 @@
 
 __BEGIN_DECLS
 
-/* Print FORMAT on stderr.  */
+/* Print "program: ", FORMAT, ": ", the standard error string for errno,
+   and a newline, on stderr.  */
 extern void warn __P ((__const char *__format, ...))
-     __attribute__ ((format (printf, 1, 2)));
+     __attribute__ ((__format__ (__printf__, 1, 2)));
 extern void vwarn __P ((__const char *__format, __gnuc_va_list))
-     __attribute__ ((format (printf, 1, 0)));
+     __attribute__ ((__format__ (__printf__, 1, 0)));
 
-/* Print "program: ", and FORMAT, and a newline, on stderr.  */
+/* Likewise, but without ": " and the standard error string.  */
 extern void warnx __P ((__const char *__format, ...))
-     __attribute__ ((format (printf, 1, 2)));
+     __attribute__ ((__format__ (__printf__, 1, 2)));
 extern void vwarnx __P ((__const char *__format, __gnuc_va_list))
-     __attribute__ ((format (printf, 1, 0)));
+     __attribute__ ((__format__ (__printf__, 1, 0)));
 
 /* Likewise, and then exit with STATUS.  */
 extern void err __P ((int __status, __const char *__format, ...))
-     __attribute__ ((noreturn, format (printf, 2, 3)));
+     __attribute__ ((__noreturn__, __format__ (__printf__, 2, 3)));
 extern void verr __P ((int __status, __const char *__format, __gnuc_va_list))
-     __attribute__ ((noreturn, format (printf, 2, 0)));
+     __attribute__ ((__noreturn__, __format__ (__printf__, 2, 0)));
 extern void errx __P ((int __status, __const char *__format, ...))
-     __attribute__ ((noreturn, format (printf, 2, 3)));
+     __attribute__ ((__noreturn__, __format__ (__printf__, 2, 3)));
 extern void verrx __P ((int __status, __const char *, __gnuc_va_list))
-     __attribute__ ((noreturn, format (printf, 2, 0)));
+     __attribute__ ((__noreturn__, __format__ (__printf__, 2, 0)));
 
 __END_DECLS
 
diff --git a/nscd/nscd_getpw_r.c b/nscd/nscd_getpw_r.c
index da4de5a461..4360f8fd71 100644
--- a/nscd/nscd_getpw_r.c
+++ b/nscd/nscd_getpw_r.c
@@ -28,6 +28,7 @@
 #include <sys/un.h>
 
 #include "nscd-client.h"
+#include "nscd_proto.h"
 
 int __nss_not_use_nscd_passwd;
 
diff --git a/sysdeps/generic/bits/libc-tsd.h b/sysdeps/generic/bits/libc-tsd.h
new file mode 100644
index 0000000000..6048d995c8
--- /dev/null
+++ b/sysdeps/generic/bits/libc-tsd.h
@@ -0,0 +1,51 @@
+/* libc-internal interface for thread-specific data.  Stub version.
+   Copyright (C) 1998 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 _BITS_LIBC_TSD_H
+#define _BITS_LIBC_TSD_H 1
+
+/* This file defines the following macros for accessing a small fixed
+   set of thread-specific `void *' data used only internally by libc.
+
+   __libc_tsd_define(CLASS, KEY)	-- Define or declare a `void *' datum
+   					   for KEY.  CLASS can be `static' for
+					   keys used in only one source file,
+					   empty for global definitions, or
+					   `extern' for global declarations.
+   __libc_tsd_get(KEY)			-- Return the `void *' datum for KEY.
+   __libc_tsd_set(KEY, VALUE)		-- Set the datum for KEY to VALUE.
+
+   The set of available KEY's will usually be provided as an enum,
+   and contains (at least):
+		_LIBC_TSD_KEY_MALLOC
+		_LIBC_TSD_KEY_DL_ERROR
+   All uses must be the literal _LIBC_TSD_* name in the __libc_tsd_* macros.
+   Some implementations may not provide any enum at all and instead
+   using string pasting in the macros.  */
+
+/* This is the generic/stub implementation for wholly single-threaded
+   systems.  We don't define an enum for the possible key values, because
+   the KEYs translate directly into variables by macro magic.  */
+
+#define __libc_tsd_define(CLASS, KEY)	CLASS void *__libc_tsd_##KEY##_data;
+#define __libc_tsd_get(KEY)		(__libc_tsd_##KEY##_data)
+#define __libc_tsd_set(KEY, VALUE)	(__libc_tsd_##KEY##_data = (VALUE))
+
+
+#endif	/* bits/libc-tsd.h */
diff --git a/sysdeps/generic/errno-loc.c b/sysdeps/generic/errno-loc.c
index 46b9f173d1..43fea06a39 100644
--- a/sysdeps/generic/errno-loc.c
+++ b/sysdeps/generic/errno-loc.c
@@ -1,6 +1,6 @@
 /* MT support function to get address of `errno' variable, non-threaded
    version.
-   Copyright (C) 1996 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1998 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
@@ -18,7 +18,8 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-extern int errno;
+#include <errno.h>
+#undef errno
 
 int *
 weak_const_function
diff --git a/sysdeps/i386/bits/string.h b/sysdeps/i386/bits/string.h
index 6885cbb019..016f414a30 100644
--- a/sysdeps/i386/bits/string.h
+++ b/sysdeps/i386/bits/string.h
@@ -45,6 +45,9 @@
 		  : memcpy (dest, src, n)))
 /* This looks horribly ugly, but the compiler can optimize it totally,
    as the count is constant.  */
+__STRING_INLINE void *__memcpy_c (void *__dest, __const void *__src,
+				  size_t __n);
+
 __STRING_INLINE void *
 __memcpy_c (void *__dest, __const void *__src, size_t __n)
 {
@@ -170,6 +173,9 @@ memmove (void *__dest, __const void *__src, size_t __n)
 		     : __memset_cg (s, 0x01010101UL * (unsigned char) (c), n))\
 		  : __memset_gg (s, c, n)))
 
+__STRING_INLINE void *__memset_cc (void *__s, unsigned long int __pattern,
+				   size_t __n);
+
 __STRING_INLINE void *
 __memset_cc (void *__s, unsigned long int __pattern, size_t __n)
 {
@@ -211,7 +217,7 @@ __memset_cc (void *__s, unsigned long int __pattern, size_t __n)
       return __s;
     case 2:
       __COMMON_CODE ("\n\tstosw");
-      return s;
+      return __s;
     case 3:
       __COMMON_CODE ("\n\tstosw\n\tstosb");
       return __s;
@@ -219,6 +225,8 @@ __memset_cc (void *__s, unsigned long int __pattern, size_t __n)
 #undef __COMMON_CODE
 }
 
+__STRING_INLINE void *__memset_cg (void *__s, unsigned long __c, size_t __n);
+
 __STRING_INLINE void *
 __memset_cg (void *__s, unsigned long __c, size_t __n)
 {
@@ -240,6 +248,8 @@ __memset_cg (void *__s, unsigned long __c, size_t __n)
   return __s;
 }
 
+__STRING_INLINE void *__memset_gg (void *__s, char __c, size_t __n);
+
 __STRING_INLINE void *
 __memset_gg (void *__s, char __c, size_t __n)
 {
@@ -455,6 +465,8 @@ strncmp (__const char *__s1, __const char *__s2, size_t __n)
 		  ? __strchr_c (s, ((c) & 0xff) << 8)			      \
 		  : __strchr_g (s, c)))
 
+__STRING_INLINE char *__strchr_g (__const char *__s, int __c);
+
 __STRING_INLINE char *
 __strchr_g (__const char *__s, int __c)
 {
@@ -478,6 +490,8 @@ __strchr_g (__const char *__s, int __c)
   return __res - 1;
 }
 
+__STRING_INLINE char *__strchr_c (__const char *__s, int __c);
+
 __STRING_INLINE char *
 __strchr_c (__const char *__s, int __c)
 {
diff --git a/sysdeps/i386/i486/bits/string.h b/sysdeps/i386/i486/bits/string.h
index 9c4bb525cc..5fe206224c 100644
--- a/sysdeps/i386/i486/bits/string.h
+++ b/sysdeps/i386/i486/bits/string.h
@@ -59,6 +59,9 @@
 	 ? __memcpy_by2 (dest, src, n)					      \
 	 : __memcpy_g (dest, src, n))))
 
+__STRING_INLINE void *__memcpy_by4 (void *__dest, __const void *__src,
+				    size_t __n);
+
 __STRING_INLINE void *
 __memcpy_by4 (void *__dest, __const void *__src, size_t __n)
 {
@@ -78,6 +81,9 @@ __memcpy_by4 (void *__dest, __const void *__src, size_t __n)
   return __dest;
 }
 
+__STRING_INLINE void *__memcpy_by2 (void *__dest, __const void *__src,
+				    size_t __n);
+
 __STRING_INLINE void *
 __memcpy_by2 (void *__dest, __const void *__src, size_t __n)
 {
@@ -102,7 +108,10 @@ __memcpy_by2 (void *__dest, __const void *__src, size_t __n)
   return __dest;
 }
 
-__STRING_INLINE void *
+__STRING_INLINE void *__memcpy_g (void *__dest, __const void *__src,
+				  size_t __n);
+
+     __STRING_INLINE void *
 __memcpy_g (void *__dest, __const void *__src, size_t __n)
 {
   register unsigned long int __d0, __d1, __d2;
@@ -203,6 +212,8 @@ memcmp (__const void *__s1, __const void *__s2, size_t __n)
 	 ? __memset_gc_by2 (s, c, n)					      \
 	 : __memset_gg (s, c, n))))
 
+__STRING_INLINE void *__memset_cc_by4 (void *__s, int __c, size_t __n);
+
 __STRING_INLINE void *
 __memset_cc_by4 (void *__s, int __c, size_t __n)
 {
@@ -220,6 +231,8 @@ __memset_cc_by4 (void *__s, int __c, size_t __n)
   return __s;
 }
 
+__STRING_INLINE void *__memset_cc_by2 (void *__s, int __c, size_t __n);
+
 __STRING_INLINE void *
 __memset_cc_by2 (void *__s, int __c, size_t __n)
 {
@@ -241,6 +254,8 @@ __memset_cc_by2 (void *__s, int __c, size_t __n)
   return __s;
 }
 
+__STRING_INLINE void *__memset_gc_by4 (void *__s, int __c, size_t __n);
+
 __STRING_INLINE void *
 __memset_gc_by4 (void *__s, int __c, size_t __n)
 {
@@ -262,6 +277,8 @@ __memset_gc_by4 (void *__s, int __c, size_t __n)
   return __s;
 }
 
+__STRING_INLINE void *__memset_gc_by2 (void *__s, int __c, size_t __n);
+
 __STRING_INLINE void *
 __memset_gc_by2 (void *__s, int __c, size_t __n)
 {
@@ -287,6 +304,8 @@ __memset_gc_by2 (void *__s, int __c, size_t __n)
   return __s;
 }
 
+__STRING_INLINE void *__memset_cg (void *__s, int __c, size_t __n);
+
 __STRING_INLINE void *
 __memset_cg (void *__s, int __c, size_t __n)
 {
@@ -304,6 +323,8 @@ __memset_cg (void *__s, int __c, size_t __n)
   return __s;
 }
 
+__STRING_INLINE void *__memset_gg (void *__s, int __c, size_t __n);
+
 __STRING_INLINE void *
 __memset_gg (void *__s, int __c, size_t __n)
 {
@@ -362,6 +383,8 @@ memchr (__const void *__s, int __c, size_t __n)
   (__extension__ (__builtin_constant_p (str)				      \
 		  ? __builtin_strlen (str)				      \
 		  : __strlen_g (str)))
+__STRING_INLINE size_t __strlen_g (__const char *__str);
+
 __STRING_INLINE size_t
 __strlen_g (__const char *__str)
 {
@@ -438,6 +461,8 @@ __strlen_g (__const char *__str)
 		      }							      \
 		    (char *) __dest; }))
 
+__STRING_INLINE char *__strcpy_g (char *__dest, __const char *__src);
+
 __STRING_INLINE char *
 __strcpy_g (char *__dest, __const char *__src)
 {
@@ -530,6 +555,9 @@ __strcpy_g (char *__dest, __const char *__src)
 		      }							      \
 		    (char *) __dest; }))
 
+__STRING_INLINE char *__mempcpy_by4 (char *__dest, __const char *__src,
+				     size_t __srclen);
+
 __STRING_INLINE char *
 __mempcpy_by4 (char *__dest, __const char *__src, size_t __srclen)
 {
@@ -549,6 +577,9 @@ __mempcpy_by4 (char *__dest, __const char *__src, size_t __srclen)
   return __tmp;
 }
 
+__STRING_INLINE char *__mempcpy_by2 (char *__dest, __const char *__src,
+				     size_t __srclen);
+
 __STRING_INLINE char *
 __mempcpy_by2 (char *__dest, __const char *__src, size_t __srclen)
 {
@@ -573,6 +604,9 @@ __mempcpy_by2 (char *__dest, __const char *__src, size_t __srclen)
   return __tmp + 2;
 }
 
+__STRING_INLINE char *__mempcpy_byn (char *__dest, __const char *__src,
+				     size_t __srclen);
+
 __STRING_INLINE char *
 __mempcpy_byn (char *__dest, __const char *__src, size_t __srclen)
 {
@@ -595,6 +629,8 @@ __mempcpy_byn (char *__dest, __const char *__src, size_t __srclen)
   return __tmp;
 }
 
+__STRING_INLINE char *__stpcpy_g (char *__dest, __const char *__src);
+
 __STRING_INLINE char *
 __stpcpy_g (char *__dest, __const char *__src)
 {
@@ -633,6 +669,9 @@ __stpcpy_g (char *__dest, __const char *__src)
       ? __strncpy_by2 (dest, src, srclen, n)				      \
       : __strncpy_byn (dest, src, srclen, n)))
 
+__STRING_INLINE char *__strncpy_by4 (char *__dest, __const char __src[],
+				     size_t __srclen, size_t __n);
+
 __STRING_INLINE char *
 __strncpy_by4 (char *__dest, __const char __src[], size_t __srclen, size_t __n)
 {
@@ -653,6 +692,9 @@ __strncpy_by4 (char *__dest, __const char __src[], size_t __srclen, size_t __n)
   return __dest;
 }
 
+__STRING_INLINE char *__strncpy_by2 (char *__dest, __const char __src[],
+				     size_t __srclen, size_t __n);
+
 __STRING_INLINE char *
 __strncpy_by2 (char *__dest, __const char __src[], size_t __srclen, size_t __n)
 {
@@ -678,6 +720,9 @@ __strncpy_by2 (char *__dest, __const char __src[], size_t __srclen, size_t __n)
   return __dest;
 }
 
+__STRING_INLINE char *__strncpy_byn (char *__dest, __const char __src[],
+				     size_t __srclen, size_t __n);
+
 __STRING_INLINE char *
 __strncpy_byn (char *__dest, __const char __src[], size_t __srclen, size_t __n)
 {
@@ -701,6 +746,9 @@ __strncpy_byn (char *__dest, __const char __src[], size_t __srclen, size_t __n)
   return __dest;
 }
 
+__STRING_INLINE char *__strncpy_gg (char *__dest, __const char *__src,
+				    size_t __n);
+
 __STRING_INLINE char *
 __strncpy_gg (char *__dest, __const char *__src, size_t __n)
 {
@@ -738,6 +786,9 @@ __strncpy_gg (char *__dest, __const char *__src, size_t __n)
 		  ? __strcat_c (dest, src, strlen (src) + 1)		      \
 		  : __strcat_g (dest, src)))
 
+__STRING_INLINE char *__strcat_c (char *__dest, __const char __src[],
+				  size_t __srclen);
+
 __STRING_INLINE char *
 __strcat_c (char *__dest, __const char __src[], size_t __srclen)
 {
@@ -765,6 +816,8 @@ __strcat_c (char *__dest, __const char __src[], size_t __srclen)
   return __dest;
 }
 
+__STRING_INLINE char *__strcat_g (char *__dest, __const char *__src);
+
 __STRING_INLINE char *
 __strcat_g (char *__dest, __const char *__src)
 {
@@ -800,6 +853,9 @@ __strcat_g (char *__dest, __const char *__src)
 				  (__const char *) src, n), __dest))	      \
 		    : __strncat_g (__dest, src, n); }))
 
+__STRING_INLINE char *__strncat_g (char *__dest, __const char __src[],
+				   size_t __n);
+
 __STRING_INLINE char *
 __strncat_g (char *__dest, __const char __src[], size_t __n)
 {
@@ -918,6 +974,8 @@ __strncat_g (char *__dest, __const char __src[], size_t __n)
 		      }							      \
 		    __result; }))
 
+__STRING_INLINE int __strcmp_gg (__const char *__s1, __const char *__s2);
+
 __STRING_INLINE int
 __strcmp_gg (__const char *__s1, __const char *__s2)
 {
@@ -954,6 +1012,9 @@ __strcmp_gg (__const char *__s1, __const char *__s2)
 		     ? strcmp (s1, s2)					      \
 		     : __strncmp_g (s1, s2, n))))
 
+__STRING_INLINE int __strncmp_g (__const char *__s1, __const char *__s2,
+				size_t __n);
+
 __STRING_INLINE int
 __strncmp_g (__const char *__s1, __const char *__s2, size_t __n)
 {
@@ -991,6 +1052,8 @@ __strncmp_g (__const char *__s1, __const char *__s2, size_t __n)
 		  ? __strchr_c (s, ((c) & 0xff) << 8)			      \
 		  : __strchr_g (s, c)))
 
+__STRING_INLINE char *__strchr_c (__const char *__s, int __c);
+
 __STRING_INLINE char *
 __strchr_c (__const char *__s, int __c)
 {
@@ -1012,6 +1075,8 @@ __strchr_c (__const char *__s, int __c)
   return __res;
 }
 
+__STRING_INLINE char *__strchr_g (__const char *__s, int __c);
+
 __STRING_INLINE char *
 __strchr_g (__const char *__s, int __c)
 {
@@ -1053,6 +1118,8 @@ __strchr_g (__const char *__s, int __c)
 		  : __strrchr_g (s, c)))
 
 #ifdef __i686__
+__STRING_INLINE char *__strrchr_c (__const char *__s, int __c);
+
 __STRING_INLINE char *
 __strrchr_c (__const char *__s, int __c)
 {
@@ -1072,6 +1139,8 @@ __strrchr_c (__const char *__s, int __c)
   return __res - 1;
 }
 
+__STRING_INLINE char *__strrchr_g (__const char *__s, int __c);
+
 __STRING_INLINE char *
 __strrchr_g (__const char *__s, int __c)
 {
@@ -1092,6 +1161,8 @@ __strrchr_g (__const char *__s, int __c)
   return __res - 1;
 }
 #else
+__STRING_INLINE char *__strrchr_c (__const char *__s, int __c);
+
 __STRING_INLINE char *
 __strrchr_c (__const char *__s, int __c)
 {
@@ -1113,6 +1184,8 @@ __strrchr_c (__const char *__s, int __c)
   return __res;
 }
 
+__STRING_INLINE char *__strrchr_g (__const char *__s, int __c);
+
 __STRING_INLINE char *
 __strrchr_g (__const char *__s, int __c)
 {
@@ -1159,6 +1232,8 @@ __strrchr_g (__const char *__s, int __c)
 			: __strcspn_cg (s, reject, strlen (reject))))	      \
 		  : __strcspn_g (s, reject)))
 
+__STRING_INLINE size_t __strcspn_c1 (__const char *__s, int __reject);
+
 __STRING_INLINE size_t
 __strcspn_c1 (__const char *__s, int __reject)
 {
@@ -1179,6 +1254,9 @@ __strcspn_c1 (__const char *__s, int __reject)
   return (__res - 1) - __s;
 }
 
+__STRING_INLINE size_t __strcspn_cg (__const char *__s, __const char __reject[],
+				    size_t __reject_len);
+
 __STRING_INLINE size_t
 __strcspn_cg (__const char *__s, __const char __reject[], size_t __reject_len)
 {
@@ -1201,7 +1279,9 @@ __strcspn_cg (__const char *__s, __const char __reject[], size_t __reject_len)
   return (__res - 1) - __s;
 }
 
+__STRING_INLINE size_t __strcspn_g (__const char *__s, __const char *__reject);
 #ifdef __PIC__
+
 __STRING_INLINE size_t
 __strcspn_g (__const char *__s, __const char *__reject)
 {
@@ -1269,6 +1349,8 @@ __strcspn_g (__const char *__s, __const char *__reject)
 			: __strspn_cg (s, accept, strlen (accept))))	      \
 		  : __strspn_g (s, accept)))
 
+__STRING_INLINE size_t __strspn_c1 (__const char *__s, int __accept);
+
 __STRING_INLINE size_t
 __strspn_c1 (__const char *__s, int __accept)
 {
@@ -1287,6 +1369,9 @@ __strspn_c1 (__const char *__s, int __accept)
   return (__res - 1) - __s;
 }
 
+__STRING_INLINE size_t __strspn_cg (__const char *__s, __const char __accept[],
+				    size_t __accept_len);
+
 __STRING_INLINE size_t
 __strspn_cg (__const char *__s, __const char __accept[], size_t __accept_len)
 {
@@ -1309,7 +1394,9 @@ __strspn_cg (__const char *__s, __const char __accept[], size_t __accept_len)
   return (__res - 1) - __s;
 }
 
+__STRING_INLINE size_t __strspn_g (__const char *__s, __const char *__accept);
 #ifdef __PIC__
+
 __STRING_INLINE size_t
 __strspn_g (__const char *__s, __const char *__accept)
 {
@@ -1375,6 +1462,9 @@ __strspn_g (__const char *__s, __const char *__accept)
 			: __strpbrk_cg (s, accept, strlen (accept))))	      \
 		  : __strpbrk_g (s, accept)))
 
+__STRING_INLINE char *__strpbrk_cg (__const char *__s, __const char __accept[],
+				    size_t __accept_len);
+
 __STRING_INLINE char *
 __strpbrk_cg (__const char *__s, __const char __accept[], size_t __accept_len)
 {
@@ -1401,7 +1491,9 @@ __strpbrk_cg (__const char *__s, __const char __accept[], size_t __accept_len)
   return __res;
 }
 
+__STRING_INLINE char *__strpbrk_g (__const char *__s, __const char *__accept);
 #ifdef __PIC__
+
 __STRING_INLINE char *
 __strpbrk_g (__const char *__s, __const char *__accept)
 {
@@ -1479,6 +1571,9 @@ __strpbrk_g (__const char *__s, __const char *__accept)
 
 /* Please note that this function need not handle NEEDLEs with a
    length shorter than two.  */
+__STRING_INLINE char *__strstr_cg (__const char *__haystack, __const char __needle[],
+				   size_t __needle_len);
+
 __STRING_INLINE char *
 __strstr_cg (__const char *__haystack, __const char __needle[],
 	     size_t __needle_len)
@@ -1504,7 +1599,9 @@ __strstr_cg (__const char *__haystack, __const char __needle[],
   return __res;
 }
 
+__STRING_INLINE char *__strstr_g (__const char *__haystack, __const char *__needle);
 #ifdef __PIC__
+
 __STRING_INLINE char *
 __strstr_g (__const char *__haystack, __const char *__needle)
 {
diff --git a/sysdeps/mach/hurd/bits/libc-tsd.h b/sysdeps/mach/hurd/bits/libc-tsd.h
new file mode 100644
index 0000000000..6f074c7d86
--- /dev/null
+++ b/sysdeps/mach/hurd/bits/libc-tsd.h
@@ -0,0 +1,37 @@
+/* libc-internal interface for thread-specific data.  Hurd version.
+   Copyright (C) 1998 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 _BITS_LIBC_TSD_H
+#define _BITS_LIBC_TSD_H 1
+
+#include <hurd/threadvar.h>
+
+#define __libc_tsd_define(CLASS, KEY) /* nothing, always have threadvars */
+
+#define __libc_tsd_threadvar_location(KEY) \
+  ((void **) __hurd_threadvar_location (_HURD_THREADVAR_##KEY))
+
+#define __libc_tsd_get(KEY) \
+  (*__libc_tsd_threadvar_location (KEY))
+
+#define __libc_tsd_set(KEY, VALUE) \
+  (*__libc_tsd_threadvar_location (KEY) = (VALUE))
+
+
+#endif	/* bits/libc-tsd.h */
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/ipc.h b/sysdeps/unix/sysv/linux/alpha/bits/ipc.h
index ec116f6114..7b644e8b7a 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/ipc.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/ipc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996, 1997, 1998 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
@@ -50,13 +50,6 @@ struct ipc_perm
   };
 
 
-/* Kludge to work around Linux' restriction of only up to five
-   arguments to a system call.  */
-struct ipc_kludge
-  {
-    void *msgp;
-    long int msgtyp;
-  };
 
 __BEGIN_DECLS
 
diff --git a/sysdeps/unix/sysv/linux/i386/setfsgid.c b/sysdeps/unix/sysv/linux/i386/setfsgid.c
index 1614431ada..434b19377b 100644
--- a/sysdeps/unix/sysv/linux/i386/setfsgid.c
+++ b/sysdeps/unix/sysv/linux/i386/setfsgid.c
@@ -17,8 +17,8 @@
    Boston, MA 02111-1307, USA.  */
 
 #include <errno.h>
-#include <unistd.h>
 #include <sys/types.h>
+#include <sys/fsuid.h>
 
 #include <sysdep.h>
 #include <sys/syscall.h>
diff --git a/sysdeps/unix/sysv/linux/i386/setfsuid.c b/sysdeps/unix/sysv/linux/i386/setfsuid.c
index a2983a5e7a..f3771694a1 100644
--- a/sysdeps/unix/sysv/linux/i386/setfsuid.c
+++ b/sysdeps/unix/sysv/linux/i386/setfsuid.c
@@ -17,8 +17,8 @@
    Boston, MA 02111-1307, USA.  */
 
 #include <errno.h>
-#include <unistd.h>
 #include <sys/types.h>
+#include <sys/fsuid.h>
 
 #include <sysdep.h>
 #include <sys/syscall.h>