about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-01-21 17:04:36 +0000
committerUlrich Drepper <drepper@redhat.com>1998-01-21 17:04:36 +0000
commit740152054ecbda66dae0e0f66193d8e244cc2376 (patch)
treeaa093561b97c930db58cecd18ac45401476d3a26 /sysdeps
parentb9b49b44fdc1c74ad85076bca9ff7ea0200e2214 (diff)
downloadglibc-740152054ecbda66dae0e0f66193d8e244cc2376.tar.gz
glibc-740152054ecbda66dae0e0f66193d8e244cc2376.tar.xz
glibc-740152054ecbda66dae0e0f66193d8e244cc2376.zip
1998-01-22 00:55  Ulrich Drepper  <drepper@happy.cygnus.com>

	* libc.map: Add __libc_uid, __libc_pid, __syscall_rt_sigqueueinfo,
	__pread64, __pwrite64, and __getpid.

	* libc/rt/aio_misc.c: Use pread and pwrite instead of __ protected
	versions.

1998-01-06  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* sysdeps/unix/sysv/linux/alpha/syscalls.list: Define the
	cancelable socket functions as __libc_xxx with __xxx as weak
	alias.
	* sysdeps/unix/sysv/linux/mips/syscalls.list: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list: Likewise.

	* sysdeps/unix/sysv/linux/m68k/socket.S: Allow __socket to be
	redefined.
	* sysdeps/unix/sysv/linux/i386/socket.S: Likewise.
	* sysdeps/unix/sysv/linux/arm/socket.S: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/socket.S: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/socket.S: Likewise.

	* sysdeps/unix/sysv/linux/accept.S: Make __libc_xxx the main name
	and __xxx a weak alias.
	* sysdeps/unix/sysv/linux/connect.S: Likewise.
	* sysdeps/unix/sysv/linux/recv.S: Likewise.
	* sysdeps/unix/sysv/linux/recvfrom.S: Likewise.
	* sysdeps/unix/sysv/linux/recvmsg.S: Likewise.
	* sysdeps/unix/sysv/linux/send.S: Likewise.
	* sysdeps/unix/sysv/linux/sendmsg.S: Likewise.
	* sysdeps/unix/sysv/linux/sendto.S: Likewise.

1998-01-21  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

	* locale/langinfo.h: Add defines.

	* dirent/dirent.h: Add defines for DT_*, check also for
	_DIRENT_HAVE_D_TYPE.
	Suggested by Roland McGrath.

1998-01-16  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

	* sysdeps/unix/sysv/linux/netinet/ip_fw.h:
	Update from Linux 2.1.73+79.

	* README.template: Update information about possible
	configurations.

	* manual/mbyte.texi (Wide String Conversion): Fix declaration of
	wcstombs. Pointed out by Jochen Voss <voss@mathematik.uni-kl.de>.
	[PR libc/417].

	* manual/time.texi (Priority): Correct description of
	PRIO_MAX. Pointed out by Jochen Voss <voss@mathematik.uni-kl.de>.
	[PR libc/416].

11998-01-21 21:34  Ulrich Drepper  <drepper@cygnus.com>

	* sysdeps/alpha/fpu/bits/mathdef.h: Add definition of FP_ILOGB0 and
	FP_ILOGNAN.   Patch by a sun <asun@zoology.washington.edu>.

1998-01-21 17:53  Ulrich Drepper  <drepper@cygnus.com>

	* sysdeps/generic/_strerror.c: Handle BUFLEN == 0.  Reported by
	Andreas Jaeger.

1998-01-20 18:13  Ulrich Drepper  <drepper@cygnus.com>

	* locale/programs/ld-collate.c: Little optimizations.

	* stdio-common/xbug.c: Unset LD_LIBRRARY_PATH variable.

	* string/Makefile (tests): Add tst-inlcall.
	* string/tst-inlcall.c: New file.

	* string/strsignal.c: Add support for real-time signals.

	* sysdeps/generic/_strerror.c: Fix Handling of unknown error in
	presense of small buffer.

	* sysdeps/i386/bits/string.h: Define _HAVE_STRING_ARCH_* macros.

	* sysdeps/i386/i486/bits/string.h: Correct strrchr implementation
	for i686.

	* sysdeps/unix/sysv/linux/siglist.c: Change length of arrays to
	_NSIG + 1.
	
1998-01-02 15:10  Matthias Urlichs   <urlichs@noris.de>

	* Rules: Add explicit rule for dummy.o; at least one library needs
	  it and it isn't autogenerated by the default rules.
	
1997-12-31  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* math/libm-test.c: Tweak epsilons.

1997-12-31  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* math/test-fenv.c (feenv_nomask_test): Avoid dumping core in the
	child.
	(feenv_mask_test): Likewise.

1998-01-01  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* Makeconfig: Don't export CPPFLAGS.

1998-01-01  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* sunrpc/rpc_main.c (parseargs): Use perror to print error
	message.

1998-01-15  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
 
	* nss/nss_db/db-alias.c (_nss_db_getaliasent_r): Don't include
	terminating null in key size.

1998-01-13  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* nss/nss_files/files-service.c: Fix allocation size to include
	length of PROTO.

	* nss/nss_db/db-XXX.c (lookup): Always set errno and h_errno if
	applicable.  Fix return value and error checking.
	(CONCAT(_nss_db_get,ENTNAME_r)): Loop around to skip over
	unparsable lines.
	(DB_LOOKUP): Allocate space for terminating null byte.

	* nss/db-Makefile ($(VAR_DB)/passwd.db): Don't handle duplicate
	uids specially.

	* db2/makedb.c (process_input): Continue processing if a duplicate
	key is encountered.

1998-01-19 15:20  Ulrich Drepper  <drepper@cygnus.com>

	* time/tzfile.h: Updated from tzcode1998b.
	* time/zdump.c: Likewise.
	* time/zic.c: Likewise.
	* time/africa: Update from tzdata1998b.
	* time/antarctica: Likewise.
	* time/asia: Likewise.
	* time/australasia: Likewise.
	* time/etcetera: Likewise.
	* time/europe: Likewise.
	* time/leapseconds: Likewise.
	* time/northamerica: Likewise.
	* time/southamerica: Likewise.
	
1998-01-12  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

	* nss/nss_files/files-alias.c (get_next_alias): Do mail alias
	lookups ignoring case.
	* nss/nss_files/files-network.c: Do network lookups ignoring
	case.
	* nss/nss_files/files-hosts.c: Do hostname lookups ignoring
	case.
	* nss/nss_files/files-parse.c (LOOKUP_NAME_CASE): New macro for
	case insensitive comparing.
	Patches by Cristian Gafton <gafton@redhat.com>.

1998-01-09  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

	* sysdeps/unix/sysv/linux/net/if.h: Add IFF_*defines.  Suggested
	by Roland McGrath. [PR libc/395]

1998-01-08  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

 	* manual/arith.texi (Parsing of Integers): Correct description of
 	strtoul. Pointed out by Scott Snyder <snyder@fnald0.fnal.gov>.
 	[PR libc/396]

1997-12-30 14:14  Matthias Urlichs  <urlichs@noris.de>

        * misc/lsearch.c (lsearch): Return a pointer to the new element
        if one was "allocated".

1997-12-26  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

        * string/strsignal.c: NSIG is not a valid index into
        _sys_siglist.  Don't zap the last character of the "Unknown
        signal" message.

1998-01-19 15:08  Ulrich Drepper  <drepper@cygnus.com>
	
	* locale/programs/charmap.c (parse_charmap): Correct parsing of
	ellipsis expressions.

	* locale/programs/charset.c (insert_char): Correctly insert value
	of eliipsis expression.
	
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/alpha/fpu/bits/mathdef.h4
-rw-r--r--sysdeps/generic/_strerror.c28
-rw-r--r--sysdeps/i386/bits/string.h39
-rw-r--r--sysdeps/i386/i486/bits/string.h12
-rw-r--r--sysdeps/unix/sysv/linux/accept.S3
-rw-r--r--sysdeps/unix/sysv/linux/alpha/syscalls.list16
-rw-r--r--sysdeps/unix/sysv/linux/arm/socket.S12
-rw-r--r--sysdeps/unix/sysv/linux/connect.S3
-rw-r--r--sysdeps/unix/sysv/linux/i386/socket.S12
-rw-r--r--sysdeps/unix/sysv/linux/m68k/socket.S12
-rw-r--r--sysdeps/unix/sysv/linux/mips/syscalls.list16
-rw-r--r--sysdeps/unix/sysv/linux/net/if.h18
-rw-r--r--sysdeps/unix/sysv/linux/netinet/ip_fw.h23
-rw-r--r--sysdeps/unix/sysv/linux/recv.S3
-rw-r--r--sysdeps/unix/sysv/linux/recvfrom.S3
-rw-r--r--sysdeps/unix/sysv/linux/recvmsg.S3
-rw-r--r--sysdeps/unix/sysv/linux/send.S3
-rw-r--r--sysdeps/unix/sysv/linux/sendmsg.S3
-rw-r--r--sysdeps/unix/sysv/linux/sendto.S3
-rw-r--r--sysdeps/unix/sysv/linux/siglist.c4
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/socket.S12
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list16
22 files changed, 162 insertions, 86 deletions
diff --git a/sysdeps/alpha/fpu/bits/mathdef.h b/sysdeps/alpha/fpu/bits/mathdef.h
index 1c259403f5..2ff626d089 100644
--- a/sysdeps/alpha/fpu/bits/mathdef.h
+++ b/sysdeps/alpha/fpu/bits/mathdef.h
@@ -63,5 +63,9 @@ typedef double double_t;
 
 #endif
 
+/* The values returned by `ilogb' for 0 and NaN respectively.  */
+#define FP_ILOGB0     0x80000001
+#define FP_ILOGBNAN   0x7fffffff
+
 /* Number of decimal digits for the `double' type.  */
 #define DECIMAL_DIG	15
diff --git a/sysdeps/generic/_strerror.c b/sysdeps/generic/_strerror.c
index bcba45d519..e6f56556aa 100644
--- a/sysdeps/generic/_strerror.c
+++ b/sysdeps/generic/_strerror.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 93, 95, 96, 97, 98 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
@@ -19,7 +19,8 @@
 #include <libintl.h>
 #include <stdio.h>
 #include <string.h>
-#include "../stdio-common/_itoa.h"
+#include <sys/param.h>
+#include <stdio-common/_itoa.h>
 
 #ifndef HAVE_GNU_LD
 #define _sys_errlist sys_errlist
@@ -41,12 +42,27 @@ _strerror_internal (int errnum, char *buf, size_t buflen)
 {
   if (errnum < 0 || errnum >= _sys_nerr)
     {
+      /* Buffer we use to print the number in.  For a maximum size for
+	 `int' of 8 bytes we never need more than 20 digits.  */
+      char numbuf[21];
       const char *unk = _("Unknown error ");
       const size_t unklen = strlen (unk);
-      char *p = buf + buflen;
-      *--p = '\0';
-      p = _itoa_word (errnum, p, 10, 0);
-      return memcpy (p - unklen, unk, unklen);
+      char *p, *q;
+
+      numbuf[20] = '\0';
+      p = _itoa_word (errnum, &numbuf[20], 10, 0);
+
+      /* Now construct the result while taking care for the destination
+	 buffer size.  */
+      q = __mempcpy (buf, unk, MIN (unklen, buflen));
+      if (unklen < buflen)
+	__stpncpy (q, p, buflen - unklen);
+
+      /* Terminate the string in any case.  */
+      if (buflen > 0)
+	buf[buflen - 1] = '\0';
+
+      return buf;
     }
 
   return (char *) _(_sys_errlist[errnum]);
diff --git a/sysdeps/i386/bits/string.h b/sysdeps/i386/bits/string.h
index c6deb2b6a4..c424306bcd 100644
--- a/sysdeps/i386/bits/string.h
+++ b/sysdeps/i386/bits/string.h
@@ -1,5 +1,5 @@
 /* Optimized, inlined string functions.  i386 version.
-   Copyright (C) 1997 Free Software Foundation, Inc.
+   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
@@ -38,6 +38,7 @@
 
 
 /* Copy N bytes of SRC to DEST.  */
+#define _HAVE_STRING_ARCH_memcpy 1
 #define memcpy(dest, src, n) \
   (__extension__ (__builtin_constant_p (n)				      \
 		  ? __memcpy_c (dest, src, n)				      \
@@ -132,6 +133,7 @@ __memcpy_c (void *__dest, __const void *__src, size_t __n)
 
 /* Copy N bytes of SRC to DEST, guaranteeing
    correct behavior for overlapping strings.  */
+#define _HAVE_STRING_ARCH_memmove 1
 __STRING_INLINE void *
 memmove (void *__dest, __const void *__src, size_t __n)
 {
@@ -158,6 +160,7 @@ memmove (void *__dest, __const void *__src, size_t __n)
 
 
 /* Set N bytes of S to C.  */
+#define _HAVE_STRING_ARCH_memset 1
 #define memset(s, c, n) \
   (__extension__ (__builtin_constant_p (c)				      \
 		  ? (__builtin_constant_p (n)				      \
@@ -249,27 +252,7 @@ __memset_gg (void *__s, char __c, size_t __n)
 
 
 /* Search N bytes of S for C.  */
-__STRING_INLINE void *
-memchr (__const void *__s, int __c, size_t __n)
-{
-  register void *__res;
-  if (count == 0)
-    return NULL;
-  __asm__ __volatile__
-    ("cld\n\t"
-     "repne; scasb\n\t"
-     "je	1f\n\t"
-     "movl	$1,%0\n"
-     "1:\n\t"
-     "decl	%0"
-     : "=D" (__res)
-     : "a" (__c), "D" (__s), "c" (__n)
-     : "cx", "cc");
-  return __res;
-}
-
-
-/* Search N bytes of S for C.  */
+#define _HAVE_STRING_ARCH_memchr 1
 __STRING_INLINE void *
 memchr (__const void *__s, int __c, size_t __n)
 {
@@ -291,6 +274,7 @@ memchr (__const void *__s, int __c, size_t __n)
 
 
 /* Return the length of S.  */
+#define _HAVE_STRING_ARCH_strlen 1
 __STRING_INLINE size_t
 strlen (__const char *__str)
 {
@@ -307,6 +291,7 @@ strlen (__const char *__str)
 
 
 /* Copy SRC to DEST.  */
+#define _HAVE_STRING_ARCH_strcpy 1
 __STRING_INLINE char *
 strcpy (char *__dest, __const char *__src)
 {
@@ -325,6 +310,7 @@ strcpy (char *__dest, __const char *__src)
 
 
 /* Copy no more than N characters of SRC to DEST.  */
+#define _HAVE_STRING_ARCH_strncpy 1
 __STRING_INLINE char *
 strncpy (char *__dest, __const char *__src, size_t __n)
 {
@@ -347,6 +333,7 @@ strncpy (char *__dest, __const char *__src, size_t __n)
 
 
 /* Append SRC onto DEST.  */
+#define _HAVE_STRING_ARCH_strcat 1
 __STRING_INLINE char *
 strcat (char *__dest, __const char *__src)
 {
@@ -367,6 +354,7 @@ strcat (char *__dest, __const char *__src)
 
 
 /* Append no more than N characters from SRC onto DEST.  */
+#define _HAVE_STRING_ARCH_strncat 1
 __STRING_INLINE char *
 strncat (char *__dest, __const char *__src, size_t __n)
 {
@@ -393,6 +381,7 @@ strncat (char *__dest, __const char *__src, size_t __n)
 
 
 /* Compare S1 and S2.  */
+#define _HAVE_STRING_ARCH_strcmp 1
 __STRING_INLINE int
 strcmp (__const char *__s1, __const char *__s2)
 {
@@ -419,6 +408,7 @@ strcmp (__const char *__s1, __const char *__s2)
 
 
 /* Compare N characters of S1 and S2.  */
+#define _HAVE_STRING_ARCH_strncmp 1
 __STRING_INLINE int
 strncmp (__const char *__s1, __const char *__s2, size_t __n)
 {
@@ -448,6 +438,7 @@ strncmp (__const char *__s1, __const char *__s2, size_t __n)
 
 
 /* Find the first occurrence of C in S.  */
+#define _HAVE_STRING_ARCH_strchr 1
 #define strchr(s, c) \
   (__extension__ (__builtin_constant_p (c)				      \
 		  ? __strchr_c (s, ((c) & 0xff) << 8)			      \
@@ -499,6 +490,7 @@ __strchr_c (__const char *__s, int __c)
 
 /* Return the length of the initial segment of S which
    consists entirely of characters not in REJECT.  */
+#define _HAVE_STRING_ARCH_strcspn 1
 #ifdef __PIC__
 __STRING_INLINE size_t
 strcspn (__const char *__s, __const char *__reject)
@@ -558,6 +550,7 @@ strcspn (__const char *__s, __const char *__reject)
 
 /* Return the length of the initial segment of S which
    consists entirely of characters in ACCEPT.  */
+#define _HAVE_STRING_ARCH_strspn 1
 #ifdef __PIC__
 __STRING_INLINE size_t
 strspn (__const char *__s, __const char *__accept)
@@ -616,6 +609,7 @@ strspn (__const char *__s, __const char *__accept)
 
 
 /* Find the first occurrence in S of any character in ACCEPT.  */
+#define _HAVE_STRING_ARCH_strpbrk 1
 #ifdef __PIC__
 __STRING_INLINE char *
 strpbrk (__const char *__s, __const char *__accept)
@@ -682,6 +676,7 @@ strpbrk (__const char *__s, __const char *__accept)
 
 
 /* Find the first occurrence of NEEDLE in HAYSTACK.  */
+#define _HAVE_STRING_ARCH_strstr 1
 #ifdef __PIC__
 __STRING_INLINE char *
 strstr (__const char *__haystack, __const char *__needle)
diff --git a/sysdeps/i386/i486/bits/string.h b/sysdeps/i386/i486/bits/string.h
index 210bf7f745..aaa636a56d 100644
--- a/sysdeps/i386/i486/bits/string.h
+++ b/sysdeps/i386/i486/bits/string.h
@@ -1,5 +1,5 @@
 /* Optimized, inlined string functions.  i486 version.
-   Copyright (C) 1997 Free Software Foundation, Inc.
+   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
@@ -373,7 +373,7 @@ __strlen_g (__const char *__str)
 		     : (char *) memcpy (dest, src, strlen (src) + 1))	      \
 		  : __strcpy_g (dest, src)))
 
-# define __strcpy_small(dest, src, srclen) \
+#define __strcpy_small(dest, src, srclen) \
   (__extension__ ({ unsigned char *__dest = (unsigned char *) (dest);	      \
 		    switch (srclen)					      \
 		      {							      \
@@ -1006,11 +1006,11 @@ __strrchr_c (__const char *__s, int __c)
      "1:\n\t"
      "lodsb\n\t"
      "cmpb	%%ah,%%al\n\t"
-     "cmovne	%%esi,%0\n\t"
+     "cmove	%%esi,%0\n\t"
      "testb	%%al,%%al\n\t"
      "jne 1b"
      : "=d" (__res)
-     : "0" (1), "S" (__s),"a" (__c)
+     : "0" (1), "S" (__s), "a" (__c)
      : "ax", "si", "cc");
   return __res - 1;
 }
@@ -1025,11 +1025,11 @@ __strrchr_g (__const char *__s, int __c)
      "1:\n\t"
      "lodsb\n\t"
      "cmpb	%%ah,%%al\n\t"
-     "cmovne	%%esi,%0\n\t"
+     "cmove	%%esi,%0\n\t"
      "testb	%%al,%%al\n\t"
      "jne 1b"
      : "=r" (__res)
-     : "0" (1), "S" (__s),"a" (__c)
+     : "0" (1), "S" (__s), "a" (__c)
      : "ax", "si", "cc");
   return __res - 1;
 }
diff --git a/sysdeps/unix/sysv/linux/accept.S b/sysdeps/unix/sysv/linux/accept.S
index b713a6e267..196634d46a 100644
--- a/sysdeps/unix/sysv/linux/accept.S
+++ b/sysdeps/unix/sysv/linux/accept.S
@@ -1,4 +1,5 @@
 #define	socket	accept
+#define	__socket __libc_accept
 #define	NARGS	3
 #include <socket.S>
-strong_alias (__accept, __libc_accept)
+weak_alias (__libc_accept, __accept)
diff --git a/sysdeps/unix/sysv/linux/alpha/syscalls.list b/sysdeps/unix/sysv/linux/alpha/syscalls.list
index 9406892124..17c55f0991 100644
--- a/sysdeps/unix/sysv/linux/alpha/syscalls.list
+++ b/sysdeps/unix/sysv/linux/alpha/syscalls.list
@@ -36,20 +36,20 @@ sys_mknod	xmknod	mknod		3	__syscall_mknod
 
 # override select.S in parent directory:
 select		-	select		5	__select	select
-accept		-	accept		3	__accept	accept
+accept		-	accept		3	__libc_accept	__accept accept
 bind		-	bind		3	__bind		bind
-connect		-	connect		3	__connect	connect
+connect		-	connect		3	__libc_connect	__connect connect
 getpeername	-	getpeername	3	__getpeername	getpeername
 getsockname	-	getsockname	3	__getsockname	getsockname
 getsockopt	-	getsockopt	5	__getsockopt	getsockopt
 listen		-	listen		2	__listen	listen
-recv		-	recv		4	__recv		recv
-recvfrom	-	recvfrom	6	__recvfrom	recvfrom
-recvmsg		-	recvmsg		3	__recvmsg	recvmsg
+recv		-	recv		4	__libc_recv	__recv recv
+recvfrom	-	recvfrom	6	__libc_recvfrom	__recvfrom recvfrom
+recvmsg		-	recvmsg		3	__libc_recvmsg	__recvmsg recvmsg
 ptrace		-	ptrace		4	__ptrace	ptrace
-send		-	send		4	__send		send
-sendmsg		-	sendmsg		3	__sendmsg	sendmsg
-sendto		-	sendto		6	__sendto	sendto
+send		-	send		4	__libc_send	__send send
+sendmsg		-	sendmsg		3	__libc_sendmsg	__sendmsg sendmsg
+sendto		-	sendto		6	__libc_sendto	__sendto sendto
 setsockopt	-	setsockopt	5	__setsockopt	setsockopt
 shutdown	-	shutdown	2	__shutdown	shutdown
 socketpair	-	socketpair	4	__socketpair	socketpair
diff --git a/sysdeps/unix/sysv/linux/arm/socket.S b/sysdeps/unix/sysv/linux/arm/socket.S
index 4d877e51d5..1940061dda 100644
--- a/sysdeps/unix/sysv/linux/arm/socket.S
+++ b/sysdeps/unix/sysv/linux/arm/socket.S
@@ -31,8 +31,12 @@
 
    The .S files for the other calls just #define socket and #include this.  */
 
-.globl P(__,socket)
-ENTRY (P(__,socket))
+#ifndef __socket
+#define __socket P(__,socket)
+#endif
+
+.globl __socket
+ENTRY (__socket)
 
         /* Do the system call trap.  */
 	swi SYS_ify(socketcall)
@@ -44,6 +48,6 @@ ENTRY (P(__,socket))
 	/* Successful; return the syscall's value.  */
 	RETINSTR(mov,pc,r14)
 
-PSEUDO_END (P(__,socket))
+PSEUDO_END (__socket)
 
-weak_alias (P(__,socket), socket)
+weak_alias (__socket, socket)
diff --git a/sysdeps/unix/sysv/linux/connect.S b/sysdeps/unix/sysv/linux/connect.S
index 2840c58174..d1dd69a217 100644
--- a/sysdeps/unix/sysv/linux/connect.S
+++ b/sysdeps/unix/sysv/linux/connect.S
@@ -1,4 +1,5 @@
 #define	socket	connect
+#define __socket __libc_connect
 #define	NARGS	3
 #include <socket.S>
-strong_alias (__connect, __libc_connect)
+weak_alias (__libc_connect, __connect)
diff --git a/sysdeps/unix/sysv/linux/i386/socket.S b/sysdeps/unix/sysv/linux/i386/socket.S
index 7c539e17d2..f649470122 100644
--- a/sysdeps/unix/sysv/linux/i386/socket.S
+++ b/sysdeps/unix/sysv/linux/i386/socket.S
@@ -31,8 +31,12 @@
 
    The .S files for the other calls just #define socket and #include this.  */
 
-.globl P(__,socket)
-ENTRY (P(__,socket))
+#ifndef __socket
+#define __socket P(__,socket)
+#endif
+
+.globl __socket
+ENTRY (__socket)
 
 	/* Save registers.  */
 	movl %ebx, %edx
@@ -56,6 +60,6 @@ ENTRY (P(__,socket))
 	/* Successful; return the syscall's value.  */
 	ret
 
-PSEUDO_END (P(__,socket))
+PSEUDO_END (__socket)
 
-weak_alias (P(__,socket), socket)
+weak_alias (__socket, socket)
diff --git a/sysdeps/unix/sysv/linux/m68k/socket.S b/sysdeps/unix/sysv/linux/m68k/socket.S
index 51aaa4b6f9..81e5a213dd 100644
--- a/sysdeps/unix/sysv/linux/m68k/socket.S
+++ b/sysdeps/unix/sysv/linux/m68k/socket.S
@@ -31,8 +31,12 @@
 
    The .S files for the other calls just #define socket and #include this.  */
 
-.globl P(__,socket)
-ENTRY (P(__,socket))
+#ifndef __socket
+#define __socket P(__,socket)
+#endif
+
+.globl __socket
+ENTRY (__socket)
 
 	/* Save registers.  */
 	move.l %d2, %a0
@@ -56,6 +60,6 @@ ENTRY (P(__,socket))
 
 	/* Successful; return the syscall's value.  */
 	rts
-PSEUDO_END (P(__,socket))
+PSEUDO_END (__socket)
 
-weak_alias (P(__,socket), socket)
+weak_alias (__socket, socket)
diff --git a/sysdeps/unix/sysv/linux/mips/syscalls.list b/sysdeps/unix/sysv/linux/mips/syscalls.list
index 6dd9cd81c5..1c9c095ed3 100644
--- a/sysdeps/unix/sysv/linux/mips/syscalls.list
+++ b/sysdeps/unix/sysv/linux/mips/syscalls.list
@@ -16,19 +16,19 @@ sigsuspend	-	sigsuspend	1	__sigsuspend	sigsuspend
 # Socket functions; Linux/MIPS doesn't use the socketcall(2) wrapper;
 # it's provided for compatibility, though.
 #
-accept		-	accept		3	__accept	accept
+ccept		-	accept		3	__libc_accept	__accept accept
 bind		-	bind		3	__bind		bind
-connect		-	connect		3	__connect	connect
+connect		-	connect		3	__libc_connect	__connect connect
 getpeername	-	getpeername	3	__getpeername	getpeername
 getsockname	-	getsockname	3	__getsockname	getsockname
 getsockopt	-	getsockopt	5	__getsockopt	getsockopt
 listen		-	listen		2	__listen	listen
-recv		-	recv		4	__recv		recv
-recvfrom	-	recvfrom	6	__recvfrom	recvfrom
-recvmsg		-	recvmsg		3	__recvmsg	recvmsg
-send		-	send		4	__send		send
-sendmsg		-	sendmsg		3	__sendmsg	sendmsg
-sendto		-	sendto		6	__sendto	sendto
+recv		-	recv		4	__libc_recv	__recv recv
+recvfrom	-	recvfrom	6	__libc_recvfrom	__recvfrom recvfrom
+recvmsg		-	recvmsg		3	__libc_recvmsg	__recvmsg recvmsg
+send		-	send		4	__libc_send	__send send
+sendmsg		-	sendmsg		3	__libc_sendmsg	__sendmsg sendmsg
+sendto		-	sendto		6	__libc_sendto	__sendto sendto
 setsockopt	-	setsockopt	5	__setsockopt	setsockopt
 shutdown	-	shutdown	2	__shutdown	shutdown
 socket		-	socket		3	__socket	socket
diff --git a/sysdeps/unix/sysv/linux/net/if.h b/sysdeps/unix/sysv/linux/net/if.h
index 468fed23e6..dd33af0337 100644
--- a/sysdeps/unix/sysv/linux/net/if.h
+++ b/sysdeps/unix/sysv/linux/net/if.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997 Free Software Foundation, Inc.
+/* 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
@@ -28,24 +28,40 @@
 enum
   {
     IFF_UP = 0x1,		/* Interface is up.  */
+#define IFF_UP	IFF_UP
     IFF_BROADCAST = 0x2,	/* Broadcast address valid.  */
+#define IFF_BROADCAST	IFF_BROADCAST
     IFF_DEBUG = 0x4,		/* Turn on debugging.  */
+#define IFF_DEBUG	IFF_DEBUG
     IFF_LOOPBACK = 0x8,		/* Is a loopback net.  */
+#define IFF_LOOPBACK	IFF_LOOPBACK
     IFF_POINTOPOINT = 0x10,	/* Interface is point-to-point link.  */
+#define IFF_POINTOPOINT	IFF_POINTOPOINT
     IFF_NOTRAILERS = 0x20,	/* Avoid use of trailers.  */
+#define IFF_NOTRAILERS	IFF_NOTRAILERS
     IFF_RUNNING = 0x40,		/* Resources allocated.  */
+#define IFF_RUNNING	IFF_RUNNING
     IFF_NOARP = 0x80,		/* No address resolution protocol.  */
+#define IFF_NOARP	IFF_NOARP
     IFF_PROMISC = 0x100,	/* Receive all packets.  */
+#define IFF_PROMISC	IFF_PROMISC
+
     /* Not supported */
     IFF_ALLMULTI = 0x200,	/* Receive all multicast packets.  */
+#define IFF_ALLMULTI	IFF_ALLMULTI
 
     IFF_MASTER = 0x400,		/* Master of a load balancer.  */
+#define IFF_MASTER	IFF_MASTER
     IFF_SLAVE = 0x800,		/* Slave of a load balancer.  */
+#define IFF_SLAVE	IFF_SLAVE
 
     IFF_MULTICAST = 0x1000,	/* Supports multicast.  */
+#define IFF_MULTICAST	IFF_MULTICAST
 
     IFF_PORTSEL = 0x2000,	/* Can set media type.  */
+#define IFF_PORTSEL	IFF_PORTSEL
     IFF_AUTOMEDIA = 0x4000	/* Auto media select active.  */
+#define IFF_AUTOMEDIA	IFF_AUTOMEDIA
   };
 
 /* The ifaddr structure contains information about one address of an
diff --git a/sysdeps/unix/sysv/linux/netinet/ip_fw.h b/sysdeps/unix/sysv/linux/netinet/ip_fw.h
index 322467b5ff..2139c37ba7 100644
--- a/sysdeps/unix/sysv/linux/netinet/ip_fw.h
+++ b/sysdeps/unix/sysv/linux/netinet/ip_fw.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 92, 93, 95, 96, 97 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 93, 95, 96, 97, 98 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
@@ -125,6 +125,7 @@ struct ip_fw {
 #define IP_FW_OUT		2
 #define IP_FW_ACCT		3
 #define IP_FW_CHAINS		4	/* total number of ip_fw chains */
+#define IP_FW_MASQ		5
 
 #define IP_FW_INSERT		(IP_FW_BASE_CTL)
 #define IP_FW_APPEND		(IP_FW_BASE_CTL+1)
@@ -165,6 +166,11 @@ struct ip_fw {
 #define IP_ACCT_FLUSH		(IP_FW_FLUSH  | (IP_FW_ACCT << IP_FW_SHIFT))
 #define IP_ACCT_ZERO		(IP_FW_ZERO   | (IP_FW_ACCT << IP_FW_SHIFT))
 
+#define IP_FW_MASQ_INSERT	(IP_FW_INSERT | (IP_FW_MASQ << IP_FW_SHIFT))
+#define IP_FW_MASQ_ADD		(IP_FW_APPEND | (IP_FW_MASQ << IP_FW_SHIFT))
+#define IP_FW_MASQ_DEL		(IP_FW_DELETE | (IP_FW_MASQ << IP_FW_SHIFT))
+#define IP_FW_MASQ_FLUSH	(IP_FW_FLUSH  | (IP_FW_MASQ << IP_FW_SHIFT))
+
 struct ip_fwpkt
 {
   struct iphdr fwp_iph;			/* IP header */
@@ -177,6 +183,21 @@ struct ip_fwpkt
   char fwp_vianame[IFNAMSIZ];	        /* interface name */
 };
 
+#define IP_FW_MASQCTL_MAX 256
+#define IP_MASQ_MOD_NMAX  32
+
+struct ip_fw_masqctl
+{
+  int mctl_action;
+  union {
+    struct {
+      char name[IP_MASQ_MOD_NMAX];
+      char data[1];
+    } mod;
+  } u;
+};
+
+
 /*
  * timeouts for ip masquerading
  */
diff --git a/sysdeps/unix/sysv/linux/recv.S b/sysdeps/unix/sysv/linux/recv.S
index d895080f9a..cb9eb91b8c 100644
--- a/sysdeps/unix/sysv/linux/recv.S
+++ b/sysdeps/unix/sysv/linux/recv.S
@@ -1,4 +1,5 @@
 #define	socket	recv
+#define	__socket __libc_recv
 #define	NARGS	4
 #include <socket.S>
-strong_alias (__recv, __libc_recv)
+weak_alias (__libc_recv, __recv)
diff --git a/sysdeps/unix/sysv/linux/recvfrom.S b/sysdeps/unix/sysv/linux/recvfrom.S
index a2c94a71bc..93a3110d0a 100644
--- a/sysdeps/unix/sysv/linux/recvfrom.S
+++ b/sysdeps/unix/sysv/linux/recvfrom.S
@@ -1,4 +1,5 @@
 #define	socket	recvfrom
+#define	__socket __libc_recvfrom
 #define	NARGS	6
 #include <socket.S>
-strong_alias (__recvfrom, __libc_recvfrom)
+weak_alias (__libc_recvfrom, __recvfrom)
diff --git a/sysdeps/unix/sysv/linux/recvmsg.S b/sysdeps/unix/sysv/linux/recvmsg.S
index e5d8cdd16a..98be36be5b 100644
--- a/sysdeps/unix/sysv/linux/recvmsg.S
+++ b/sysdeps/unix/sysv/linux/recvmsg.S
@@ -1,4 +1,5 @@
 #define	socket	recvmsg
+#define	__socket __libc_recvmsg
 #define	NARGS	3
 #include <socket.S>
-strong_alias (__recvmsg, __libc_recvmsg)
+weak_alias (__libc_recvmsg, __recvmsg)
diff --git a/sysdeps/unix/sysv/linux/send.S b/sysdeps/unix/sysv/linux/send.S
index 5191265f62..3f5e00ce9e 100644
--- a/sysdeps/unix/sysv/linux/send.S
+++ b/sysdeps/unix/sysv/linux/send.S
@@ -1,4 +1,5 @@
 #define	socket	send
+#define	__socket __libc_send
 #define	NARGS	4
 #include <socket.S>
-strong_alias (__send, __libc_send)
+weak_alias (__libc_send, __send)
diff --git a/sysdeps/unix/sysv/linux/sendmsg.S b/sysdeps/unix/sysv/linux/sendmsg.S
index 6f511af1c7..c01d9b68e7 100644
--- a/sysdeps/unix/sysv/linux/sendmsg.S
+++ b/sysdeps/unix/sysv/linux/sendmsg.S
@@ -1,4 +1,5 @@
 #define	socket	sendmsg
+#define	__socket __libc_sendmsg
 #define	NARGS	3
 #include <socket.S>
-strong_alias (__sendmsg, __libc_sendmsg)
+weak_alias (__libc_sendmsg, __sendmsg)
diff --git a/sysdeps/unix/sysv/linux/sendto.S b/sysdeps/unix/sysv/linux/sendto.S
index b34a609a93..8717b2bac1 100644
--- a/sysdeps/unix/sysv/linux/sendto.S
+++ b/sysdeps/unix/sysv/linux/sendto.S
@@ -1,4 +1,5 @@
 #define	socket	sendto
+#define	__socket __libc_sendto
 #define	NARGS	6
 #include <socket.S>
-strong_alias (__sendto, __libc_sendto)
+weak_alias (__libc_sendto, __sendto)
diff --git a/sysdeps/unix/sysv/linux/siglist.c b/sysdeps/unix/sysv/linux/siglist.c
index 6bb8562899..43b229fc95 100644
--- a/sysdeps/unix/sysv/linux/siglist.c
+++ b/sysdeps/unix/sysv/linux/siglist.c
@@ -1,14 +1,14 @@
 #include <stddef.h>
 #include <signal.h>
 
-const char * const __new_sys_siglist[NSIG] =
+const char * const __new_sys_siglist[NSIG + 1] =
 {
 #define init_sig(sig, abbrev, desc)   [sig] desc,
 #include "siglist.h"
 #undef init_sig
 };
 
-const char * const __new_sys_sigabbrev[NSIG] =
+const char * const __new_sys_sigabbrev[NSIG + 1] =
 {
 #define init_sig(sig, abbrev, desc)   [sig] abbrev,
 #include "siglist.h"
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/socket.S b/sysdeps/unix/sysv/linux/sparc/sparc32/socket.S
index 4c65ac7f3c..8d6fd77c10 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/socket.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/socket.S
@@ -39,8 +39,12 @@
 
    The .S files for the other calls just #define socket and #include this.  */
 
-.globl P(__,socket)
-ENTRY (P(__,socket))
+#ifndef __socket
+#define __socket P(__,socket)
+#endif
+
+.globl __socket
+ENTRY (__socket)
 
 	/* Drop up to 6 arguments (recvfrom) into the memory allocated by
 	   the caller for varargs, since that's really what we have.  */
@@ -71,6 +75,6 @@ ENTRY (P(__,socket))
 
 1:	SYSCALL_ERROR_HANDLER
 
-END (P(__,socket))
+END (__socket)
 
-weak_alias (P(__,socket), socket)
+weak_alias (__socket, socket)
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list b/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list
index ca142da29c..3f62a7cd53 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list
@@ -14,19 +14,19 @@ mmap		-	mmap		6	__mmap		mmap __mmap64 mmap64
 
 # Override select.S in parent directory:
 select		-	select		5	__select	select
-accept		-	accept		3	__accept	accept
+accept		-	accept		3	__libc_accept	__accept accept
 bind		-	bind		3	__bind		bind
-connect		-	connect		3	__connect	connect
+connect		-	connect		3	__libc_connect	__connect connect
 getpeername	-	getpeername	3	__getpeername	getpeername
 getsockname	-	getsockname	3	__getsockname	getsockname
 getsockopt	-	getsockopt	5	__getsockopt	getsockopt
 listen		-	listen		2	__listen	listen
-recv		-	recv		4	__recv		recv
-recvfrom	-	recvfrom	6	__recvfrom	recvfrom
-recvmsg		-	recvmsg		3	__recvmsg	recvmsg
-send		-	send		4	__send		send
-sendmsg		-	sendmsg		3	__sendmsg	sendmsg
-sendto		-	sendto		6	__sendto	sendto
+recv		-	recv		4	__libc_recv	__recv recv
+recvfrom	-	recvfrom	6	__libc_recvfrom	__recvfrom recvfrom
+recvmsg		-	recvmsg		3	__libc_recvmsg	__recvmsg recvmsg
+send		-	send		4	__libc_send	__send send
+sendmsg		-	sendmsg		3	__libc_sendmsg	__sendmsg sendmsg
+sendto		-	sendto		6	__libc_sendto	__sendto sendto
 setsockopt	-	setsockopt	5	__setsockopt	setsockopt
 shutdown	-	shutdown	2	__shutdown	shutdown
 socketpair	-	socketpair	4	__socketpair	socketpair