summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog128
-rw-r--r--include/netinet/in.h4
-rw-r--r--include/rpc/auth.h9
-rw-r--r--include/rpc/clnt.h22
-rw-r--r--include/rpc/svc.h17
-rw-r--r--include/rpc/svc_auth.h4
-rw-r--r--include/sys/socket.h54
-rw-r--r--inet/rcmd.c4
-rw-r--r--inet/rexec.c4
-rw-r--r--locale/programs/localedef.c2
-rw-r--r--locale/programs/localedef.h4
-rw-r--r--locale/programs/locarchive.c178
-rw-r--r--locale/programs/locfile.c2
-rw-r--r--malloc/malloc.c3
-rw-r--r--sunrpc/auth_des.c3
-rw-r--r--sunrpc/auth_none.c1
-rw-r--r--sunrpc/auth_unix.c4
-rw-r--r--sunrpc/bindrsvprt.c3
-rw-r--r--sunrpc/clnt_gen.c7
-rw-r--r--sunrpc/clnt_raw.c4
-rw-r--r--sunrpc/clnt_simp.c2
-rw-r--r--sunrpc/clnt_tcp.c5
-rw-r--r--sunrpc/clnt_udp.c25
-rw-r--r--sunrpc/clnt_unix.c9
-rw-r--r--sunrpc/key_call.c14
-rw-r--r--sunrpc/pm_getmaps.c4
-rw-r--r--sunrpc/pm_getport.c5
-rw-r--r--sunrpc/pmap_clnt.c10
-rw-r--r--sunrpc/pmap_rmt.c16
-rw-r--r--sunrpc/rtime.c8
-rw-r--r--sunrpc/svc.c14
-rw-r--r--sunrpc/svc_auth.c1
-rw-r--r--sunrpc/svc_run.c2
-rw-r--r--sunrpc/svc_simple.c14
-rw-r--r--sunrpc/svc_tcp.c8
-rw-r--r--sunrpc/svc_udp.c37
-rw-r--r--sunrpc/svc_unix.c12
-rw-r--r--sysdeps/generic/bind.c5
-rw-r--r--sysdeps/generic/getsockname.c5
-rw-r--r--sysdeps/generic/listen.c5
-rw-r--r--sysdeps/generic/recvfrom.c6
-rw-r--r--sysdeps/generic/recvmsg.c6
-rw-r--r--sysdeps/generic/sendmsg.c6
-rw-r--r--sysdeps/generic/sendto.c6
-rw-r--r--sysdeps/generic/setsockopt.c6
-rw-r--r--sysdeps/generic/unwind-dw2-fde.c22
-rw-r--r--sysdeps/mach/hurd/bind.c4
-rw-r--r--sysdeps/mach/hurd/getsockname.c6
-rw-r--r--sysdeps/mach/hurd/listen.c7
-rw-r--r--sysdeps/mach/hurd/recvfrom.c6
-rw-r--r--sysdeps/mach/hurd/recvmsg.c3
-rw-r--r--sysdeps/mach/hurd/sendmsg.c3
-rw-r--r--sysdeps/mach/hurd/sendto.c14
-rw-r--r--sysdeps/mach/hurd/setsockopt.c13
-rw-r--r--sysdeps/unix/inet/syscalls.list14
-rw-r--r--sysdeps/unix/sysv/aix/getsockname.c6
-rw-r--r--sysdeps/unix/sysv/aix/recvfrom.c8
-rw-r--r--sysdeps/unix/sysv/aix/recvmsg.c6
-rw-r--r--sysdeps/unix/sysv/aix/sendmsg.c7
-rw-r--r--sysdeps/unix/sysv/linux/alpha/syscalls.list4
-rw-r--r--sysdeps/unix/sysv/linux/bind.S1
-rw-r--r--sysdeps/unix/sysv/linux/getsockname.S1
-rw-r--r--sysdeps/unix/sysv/linux/hppa/syscalls.list4
-rw-r--r--sysdeps/unix/sysv/linux/ia64/syscalls.list4
-rw-r--r--sysdeps/unix/sysv/linux/listen.S1
-rw-r--r--sysdeps/unix/sysv/linux/recvfrom.S1
-rw-r--r--sysdeps/unix/sysv/linux/recvmsg.S1
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list4
-rw-r--r--sysdeps/unix/sysv/linux/sendmsg.S1
-rw-r--r--sysdeps/unix/sysv/linux/sendto.S1
-rw-r--r--sysdeps/unix/sysv/linux/setsockopt.S1
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/syscalls.list4
72 files changed, 636 insertions, 199 deletions
diff --git a/ChangeLog b/ChangeLog
index a334247972..6eec316c0b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,133 @@
+2002-05-11  Jakub Jelinek  <jakub@redhat.com>
+
+	* include/netinet/in.h (bindresvport_internal): Add prototype.
+	* include/rpc/auth.h  (authunix_create_internal,
+	authunix_create_default_internal, authnone_create_internal,
+	authdes_pk_create_internal): Add prototypes.
+	* include/rpc/clnt.h (clnt_create_internal, clnttcp_create_internal,
+	clntudp_create_internal, clntudp_bufcreate_internal,
+	clntunix_create_internal): Add prototypes.
+	* include/rpc/svc.h (svc_sendreply_internal, svcerr_decode_internal,
+	svc_getreq_internal, svc_getreq_common_internal,
+	svc_getreqset_internal, svc_getreq_poll_internal,
+	svc_register_internal, svc_unregister_internal,
+	svcudp_create_internal, svcudp_bufcreate_internal): Add prototypes.
+	* include/rpc/svc_auth.h (_authenticate_internal): Add prototype.
+	* include/sys/socket.h (__sendto, __recvfrom, __sendmsg, __recvmsg,
+	__setsockopt, __getsockname, __bind, __listen): Add prototypes.
+	* inet/rexec.c (rexec_af): Use __listen and __getsockname.
+	* inet/rcmd.c (rcmd_af): Use __listen.
+	(rresvport_af): Use __bind.
+	* sunrpc/clnt_udp.c: Use INTUSE calls to bindresvport,
+	authunix_create, authunix_create_default, authnone_create,
+	authdes_pk_create, clnt_create, clnttcp_create, clntudp_create,
+	clntudp_bufcreate, clntunix_create svc_sendreply, svcerr_decode,
+	svc_getreq, svc_getreq_common, svc_getreqset, svc_getreq_poll,
+	svc_register, svc_unregister, svcudp_create, svcudp_bufcreate,
+	_authenticate, add INTDEF after such function definitions.
+	Use __listen, __bind, __sendto, __recvfrom, __sendmsg, __recvmsg,
+	__setsockopt, __getsockname instead of non-__ variants.
+	* sunrpc/pmap_rmt.c: Likewise.
+	* sunrpc/rtime.c: Likewise.
+	* sunrpc/svc_udp.c: Likewise.
+	* sunrpc/clnt_unix.c: Likewise.
+	* sunrpc/svc_unix.c: Likewise.
+	* sunrpc/bindrsvprt.c: Likewise.
+	* sunrpc/svc_tcp.c: Likewise.
+	* sunrpc/auth_none.c: Likewise.
+	* sunrpc/clnt_raw.c: Likewise.
+	* sunrpc/clnt_tcp.c: Likewise.
+	* sunrpc/auth_unix.c: Likewise.
+	* sunrpc/key_call.c: Likewise.
+	* sunrpc/clnt_gen.c: Likewise.
+	* sunrpc/pm_getmaps.c: Likewise.
+	* sunrpc/clnt_simp.c: Likewise.
+	* sunrpc/pmap_clnt.c: Likewise.
+	* sunrpc/svc_run.c: Likewise.
+	* sunrpc/svc.c: Likewise.
+	* sunrpc/svc_simple.c: Likewise.
+	* sunrpc/pm_getport.c: Likewise.
+	* sunrpc/auth_des.c: Likewise.
+	* sunrpc/svc_auth.c: Likewise.
+	* sysdeps/generic/unwind-dw2-fde.c (__register_frame_info_bases,
+	__register_frame_info_table_bases, __deregister_frame_info_bases):
+	Add INTDEF.
+	(__register_frame_info_bases_internal,
+	__register_frame_info_table_bases_internal,
+	__deregister_frame_info_bases_internal): Add prototypes.
+	(__register_frame_info, __register_frame): Use INTUSE in call to
+	__register_frame_info_bases.
+	(__register_frame_info_table): Similarly.
+	(__deregister_frame_info, __deregister_frame): Similarly.
+	* sysdeps/generic/sendto.c (__sendto): Renamed from sendto, add
+	sendto as weak alias.
+	* sysdeps/mach/hurd/sendto.c: Likewise.
+	* sysdeps/generic/recvfrom.c (__recvfrom): Renamed from recvfrom, add
+	recvfrom as weak alias.
+	* sysdeps/mach/hurd/recvfrom.c: Likewise.
+	* sysdeps/unix/sysv/aix/recvfrom.c: Likewise.
+	* sysdeps/generic/recvmsg.c (__recvmsg): Renamed from recvmsg, add
+	recvmsg as weak alias.
+	* sysdeps/unix/sysv/aix/recvmsg.c: Likewise.
+	* sysdeps/generic/sendmsg.c (__sendmsg): Renamed from sendmsg, add
+	sendmsg as weak alias.
+	* sysdeps/unix/sysv/aix/sendmsg.c: Likewise.
+	* sysdeps/generic/setsockopt.c (__setsockopt): Renamed from
+	setsockopt, add setsockopt as weak alias.
+	* sysdeps/mach/hurd/setsockopt.c: Likewise.
+	* sysdeps/generic/bind.c (__bind): Renamed from bind, add bind as
+	weak alias.
+	* sysdeps/mach/hurd/bind.c: Likewise.
+	* sysdeps/generic/listen.c (__listen): Renamed from listen, add listen
+	as weak alias.
+	* sysdeps/mach/hurd/listen.c: Likewise.
+	* sysdeps/generic/getsockname.c (__getsockname): Renamed from
+	getsockname, add getsockname as weak alias.
+	* sysdeps/mach/hurd/getsockname.c: Likewise.
+	* sysdeps/unix/sysv/aix/getsockname.c: Likewise.
+	* sysdeps/mach/hurd/recvmsg.c (__recvmsg): Add weak alias.
+	* sysdeps/mach/hurd/sendmsg.c (__sendmsg): Add weak alias.
+	* sysdeps/unix/inet/syscalls.list (__bind, __listen, __recvmsg,
+	__recvfrom, __sendmsg, __sendto, __setsockopt): Add aliases.
+	* sysdeps/unix/sysv/linux/alpha/syscalls.list (__recvmsg, __sendmsg):
+	Add aliases.
+	* sysdeps/unix/sysv/linux/ia64/syscalls.list: Likewise.
+	* sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list: Likewise.
+	* sysdeps/unix/sysv/linux/hppa/syscalls.list: Likewise.
+	* sysdeps/unix/sysv/linux/x86_64/syscalls.list: Likewise.
+	* sysdeps/unix/sysv/linux/recvfrom.S (__recvfrom): Add weak alias.
+	* sysdeps/unix/sysv/linux/recvmsg.S (__recvmsg): Likewise.
+	* sysdeps/unix/sysv/linux/sendmsg.S (__sendmsg): Likewise.
+	* sysdeps/unix/sysv/linux/sendto.S (__sendto): Likewise.
+	* sysdeps/unix/sysv/linux/setsockopt.S (__setsockopt): Likewise.
+	* sysdeps/unix/sysv/linux/bind.S (__bind): Likewise.
+	* sysdeps/unix/sysv/linux/listen.S (__listen): Likewise.
+	* sysdeps/unix/sysv/linux/getsockname.S (__getsockname): Likewise.
+
+2002-05-10  Jakub Jelinek  <jakub@redhat.com>
+
+	* locale/programs/localedef.h (show_archive_content): Add verbose
+	argument.
+	* locale/programs/localedef.c (main): Adjust caller.
+	* locale/programs/locarchive.c (struct nameent, struct dataent): New.
+	(nameentcmp, dataentcmp): New functions.
+	(xstrcmp): Remove.
+	(show_archive_content): Print verbose listing with --list-archive -v.
+
 2002-05-14  Ulrich Drepper  <drepper@redhat.com>
 
+	* locale/programs/locarchive.c (open_archive): Take extra argument
+	readonly.  If true open file with O_RDONLY and don't create the
+	archive if it doesn't exist.
+	Adapt all callers.
+	(close_archive): Don't do anything if fd element is -1.
+	* locale/programs/localedef.h (open_archive): Adjust prototype.
+	* locale/programs/locfile.c (write_all_categories): Adjust open_archive
+	call.
+
+	* malloc/malloc.c (__posix_memalign): Correct check for size of
+	alignment value [PR libc/3444].
+
 	* include/stdio.h: Remove references to old stdio implementation.
 
 	* libio/Makefile (bug-ungetwc2-ENV): Define.
diff --git a/include/netinet/in.h b/include/netinet/in.h
index b85d938181..2a57aceb5e 100644
--- a/include/netinet/in.h
+++ b/include/netinet/in.h
@@ -1,3 +1,7 @@
 #include <inet/netinet/in.h>
 
 extern const struct in6_addr in6addr_any_internal attribute_hidden;
+
+/* Bind socket to a privileged IP port.  */
+extern int bindresvport_internal (int __sockfd,
+				  struct sockaddr_in *__sock_in) attribute_hidden;
diff --git a/include/rpc/auth.h b/include/rpc/auth.h
index bc19049291..9bfde8331b 100644
--- a/include/rpc/auth.h
+++ b/include/rpc/auth.h
@@ -19,4 +19,13 @@ DECLARE_NSS_PROTOTYPES (nisplus)
 extern bool_t xdr_des_block_internal (XDR *__xdrs, des_block *__blkp);
 extern bool_t xdr_opaque_auth_internal (XDR *, struct opaque_auth *);
 
+extern AUTH *authunix_create_internal (char *__machname, __uid_t __uid,
+				       __gid_t __gid, int __len,
+				       __gid_t *__aup_gids) attribute_hidden;
+extern AUTH *authunix_create_default_internal (void) attribute_hidden;
+extern AUTH *authnone_create_internal (void) attribute_hidden;
+extern AUTH *authdes_pk_create_internal (const char *, netobj *, u_int,
+					 struct sockaddr *,
+					 des_block *) attribute_hidden;
+
 #endif
diff --git a/include/rpc/clnt.h b/include/rpc/clnt.h
index 071c008eb6..13844962be 100644
--- a/include/rpc/clnt.h
+++ b/include/rpc/clnt.h
@@ -4,4 +4,26 @@
 /* Now define the internal interfaces.  */
 extern int _openchild (const char *command, FILE **fto, FILE **ffrom);
 
+extern CLIENT *clnt_create_internal (__const char *__host,
+				     __const u_long __prog,
+				     __const u_long __vers,
+				     __const char *__prot) attribute_hidden;
+extern CLIENT *clnttcp_create_internal (struct sockaddr_in *__raddr,
+					u_long __prog, u_long __version,
+					int *__sockp, u_int __sendsz,
+					u_int __recvsz) attribute_hidden;
+extern CLIENT *clntudp_create_internal (struct sockaddr_in *__raddr,
+					u_long __program, u_long __version,
+					struct timeval __wait_resend,
+					int *__sockp) attribute_hidden;
+extern CLIENT *clntudp_bufcreate_internal (struct sockaddr_in *__raddr,
+					   u_long __program, u_long __version,
+					   struct timeval __wait_resend,
+					   int *__sockp, u_int __sendsz,
+					   u_int __recvsz) attribute_hidden;
+extern CLIENT *clntunix_create_internal (struct sockaddr_un *__raddr,
+					 u_long __program, u_long __version,
+					 int *__sockp, u_int __sendsz,
+					 u_int __recvsz) attribute_hidden;
+
 #endif
diff --git a/include/rpc/svc.h b/include/rpc/svc.h
index bf948d51e2..063e6f3976 100644
--- a/include/rpc/svc.h
+++ b/include/rpc/svc.h
@@ -10,5 +10,22 @@ extern SVCXPRT *svcfd_create (int fd, u_int sendsize, u_int recvsize);
 
 extern int svcudp_enablecache (SVCXPRT *transp, u_long size);
 extern SVCXPRT *svcunixfd_create (int fd, u_int sendsize, u_int recvsize);
+extern bool_t svc_sendreply_internal (SVCXPRT *xprt, xdrproc_t __xdr_results,
+				      caddr_t __xdr_location) attribute_hidden;
+extern void svcerr_decode_internal (SVCXPRT *__xprt) attribute_hidden;
+extern void svc_getreq_internal (int __rdfds) attribute_hidden;
+extern void svc_getreq_common_internal (const int __fd) attribute_hidden;
+extern void svc_getreqset_internal (fd_set *__readfds) attribute_hidden;
+extern void svc_getreq_poll_internal (struct pollfd *,
+				      const int) attribute_hidden;
+extern bool_t svc_register_internal (SVCXPRT *__xprt, rpcprog_t __prog,
+				     rpcvers_t __vers,
+				     __dispatch_fn_t __dispatch,
+				     rpcprot_t __protocol) attribute_hidden;
+extern void svc_unregister_internal (rpcprog_t __prog,
+				     rpcvers_t __vers) attribute_hidden;
+extern SVCXPRT *svcudp_create_internal (int __sock) attribute_hidden;
+extern SVCXPRT *svcudp_bufcreate_internal (int __sock, u_int __sendsz,
+					   u_int __recvsz) attribute_hidden;
 
 #endif
diff --git a/include/rpc/svc_auth.h b/include/rpc/svc_auth.h
index 9d2462bacb..bf5ce91b68 100644
--- a/include/rpc/svc_auth.h
+++ b/include/rpc/svc_auth.h
@@ -6,7 +6,7 @@ extern enum auth_stat _svcauth_unix (struct svc_req *rqst,
 				     struct rpc_msg *msg);
 extern enum auth_stat _svcauth_short (struct svc_req *rqst,
 				      struct rpc_msg *msg);
-
-
+extern enum auth_stat _authenticate_internal (struct svc_req *__rqst,
+				struct rpc_msg *__msg) attribute_hidden;
 
 #endif
diff --git a/include/sys/socket.h b/include/sys/socket.h
index 5a8169ffc8..b97c354276 100644
--- a/include/sys/socket.h
+++ b/include/sys/socket.h
@@ -2,22 +2,24 @@
 #include <socket/sys/socket.h>
 
 /* Now define the internal interfaces.  */
-extern int __socket (int __domain, int __type, int __protocol);
+extern int __socket (int __domain, int __type,
+		     int __protocol) attribute_hidden;
 
 /* Create two new sockets, of type TYPE in domain DOMAIN and using
    protocol PROTOCOL, which are connected to each other, and put file
    descriptors for them in FDS[0] and FDS[1].  If PROTOCOL is zero,
    one will be chosen automatically.  Returns 0 on success, -1 for errors.  */
 extern int __socketpair (int __domain, int __type, int __protocol,
-			 int __fds[2]);
+			 int __fds[2]) attribute_hidden;
 
 /* Return a socket of any type.  The socket can be used in subsequent
    ioctl calls to talk to the kernel.  */
-extern int __opensock (void) internal_function;
+extern int __opensock (void) internal_function attribute_hidden;
 
 /* Put the address of the peer connected to socket FD into *ADDR
    (which is *LEN bytes long), and its actual length into *LEN.  */
-extern int __getpeername (int __fd, __SOCKADDR_ARG __addr, socklen_t *__len);
+extern int __getpeername (int __fd, __SOCKADDR_ARG __addr,
+			  socklen_t *__len) attribute_hidden;
 
 /* Send N bytes of BUF to socket FD.  Returns the number sent or -1.  */
 extern ssize_t __send (int __fd, __const void *__buf, size_t __n, int __flags);
@@ -30,6 +32,50 @@ extern int __connect (int __fd, __CONST_SOCKADDR_ARG __addr, socklen_t __len);
 extern int __connect_internal (int __fd, __CONST_SOCKADDR_ARG __addr,
 			       socklen_t __len) attribute_hidden;
 
+/* Send N bytes of BUF on socket FD to peer at address ADDR (which is
+   ADDR_LEN bytes long).  Returns the number sent, or -1 for errors.  */
+extern ssize_t __sendto (int __fd, __const void *__buf, size_t __n,
+			 int __flags, __CONST_SOCKADDR_ARG __addr,
+			 socklen_t __addr_len) attribute_hidden;
+
+/* Read N bytes into BUF through socket FD.
+   If ADDR is not NULL, fill in *ADDR_LEN bytes of it with tha address of
+   the sender, and store the actual size of the address in *ADDR_LEN.
+   Returns the number of bytes read or -1 for errors.  */
+extern ssize_t __recvfrom (int __fd, void *__restrict __buf, size_t __n,
+			   int __flags, __SOCKADDR_ARG __addr,
+			   socklen_t *__restrict __addr_len) attribute_hidden;
+
+/* Send a message described MESSAGE on socket FD.
+   Returns the number of bytes sent, or -1 for errors.  */
+extern ssize_t __sendmsg (int __fd, __const struct msghdr *__message,
+			  int __flags) attribute_hidden;
+
+/* Receive a message as described by MESSAGE from socket FD.
+   Returns the number of bytes read or -1 for errors.  */
+extern ssize_t __recvmsg (int __fd, struct msghdr *__message,
+			  int __flags) attribute_hidden;
+
+/* Set socket FD's option OPTNAME at protocol level LEVEL
+   to *OPTVAL (which is OPTLEN bytes long).
+   Returns 0 on success, -1 for errors.  */
+extern int __setsockopt (int __fd, int __level, int __optname,
+			 __const void *__optval,
+			 socklen_t __optlen) attribute_hidden;
+
+/* Put the local address of FD into *ADDR and its length in *LEN.  */
+extern int __getsockname (int __fd, __SOCKADDR_ARG __addr,
+			  socklen_t *__restrict __len) attribute_hidden;
+
+/* Give the socket FD the local address ADDR (which is LEN bytes long).  */
+extern int __bind (int __fd, __CONST_SOCKADDR_ARG __addr,
+		   socklen_t __len) attribute_hidden;
+
+/* Prepare to accept connections on socket FD.
+   N connection requests will be queued before further requests are refused.
+   Returns 0 on success, -1 for errors.  */
+extern int __listen (int __fd, int __n) attribute_hidden;
+
 /* Return the length of a `sockaddr' structure.  */
 #ifdef _HAVE_SA_LEN
 # define SA_LEN(_x)      (_x)->sa_len
diff --git a/inet/rcmd.c b/inet/rcmd.c
index 4010bacfb0..8ad6f31e4f 100644
--- a/inet/rcmd.c
+++ b/inet/rcmd.c
@@ -268,7 +268,7 @@ rcmd_af(ahost, rport, locuser, remuser, cmd, fd2p, af)
 
 		if (s2 < 0)
 			goto bad;
-		listen(s2, 1);
+		__listen(s2, 1);
 		(void)__snprintf(num, sizeof(num), "%d", lport);
 		if (__write(s, num, strlen(num)+1) != (ssize_t)strlen(num)+1) {
 			char *buf = NULL;
@@ -444,7 +444,7 @@ rresvport_af(alport, family)
 
 	for (;;) {
 		*sport = htons((uint16_t) *alport);
-		if (bind(s, (struct sockaddr *)&ss, len) >= 0)
+		if (__bind(s, (struct sockaddr *)&ss, len) >= 0)
 			return s;
 		if (errno != EADDRINUSE) {
 			(void)__close(s);
diff --git a/inet/rexec.c b/inet/rexec.c
index c22e53d474..e8ecf79c54 100644
--- a/inet/rexec.c
+++ b/inet/rexec.c
@@ -115,9 +115,9 @@ retry:
 			(void) __close(s);
 			return (-1);
 		}
-		listen(s2, 1);
+		__listen(s2, 1);
 		sa2len = sizeof (sa2);
-		if (getsockname(s2, (struct sockaddr *)&sa2, &sa2len) < 0) {
+		if (__getsockname(s2, (struct sockaddr *)&sa2, &sa2len) < 0) {
 			perror("getsockname");
 			(void) __close(s2);
 			goto bad;
diff --git a/locale/programs/localedef.c b/locale/programs/localedef.c
index 37b52b08c6..c1d347b06a 100644
--- a/locale/programs/localedef.c
+++ b/locale/programs/localedef.c
@@ -202,7 +202,7 @@ main (int argc, char *argv[])
 
   /* Handle a few special cases.  */
   if (list_archive)
-    show_archive_content ();
+    show_archive_content (verbose);
   if (add_to_archive)
     return add_locales_to_archive (argc - remaining, &argv[remaining],
 				   replace_archive);
diff --git a/locale/programs/localedef.h b/locale/programs/localedef.h
index 9567845080..3217338ee7 100644
--- a/locale/programs/localedef.h
+++ b/locale/programs/localedef.h
@@ -159,7 +159,7 @@ extern struct localedef_t *load_locale (int locale, const char *name,
 
 
 /* Open the locale archive.  */
-extern void open_archive (struct locarhandle *ah);
+extern void open_archive (struct locarhandle *ah, bool readonly);
 
 /* Close the locale archive.  */
 extern void close_archive (struct locarhandle *ah);
@@ -175,6 +175,6 @@ extern int add_locales_to_archive (size_t nlist, char *list[], bool replace);
 extern int delete_locales_from_archive (size_t nlist, char *list[]);
 
 /* List content of locale archive.  */
-extern void show_archive_content (void);
+extern void show_archive_content (int verbose);
 
 #endif /* localedef.h */
diff --git a/locale/programs/locarchive.c b/locale/programs/locarchive.c
index be5514790e..9ef373a2e5 100644
--- a/locale/programs/locarchive.c
+++ b/locale/programs/locarchive.c
@@ -142,7 +142,7 @@ create_archive (const char *archivefname, struct locarhandle *ah)
 	{
 	  /* There is already an archive.  Must have been a localedef run
 	     which happened in parallel.  Simply open this file then.  */
-	  open_archive (ah);
+	  open_archive (ah, false);
 	  return;
 	}
 
@@ -334,7 +334,7 @@ enlarge_archive (struct locarhandle *ah, const struct locarhead *head)
 
 
 void
-open_archive (struct locarhandle *ah)
+open_archive (struct locarhandle *ah, bool readonly)
 {
   struct stat64 st;
   struct stat64 st2;
@@ -350,13 +350,27 @@ open_archive (struct locarhandle *ah)
 
  again:
   /* Open the archive.  We must have exclusive write access.  */
-  fd = open64 (archivefname, O_RDWR);
+  fd = open64 (archivefname, readonly ? O_RDONLY : O_RDWR);
   if (fd == -1)
     {
       /* Maybe the file does not yet exist.  */
       if (errno == ENOENT)
 	{
-	  create_archive (archivefname, ah);
+	  if (readonly)
+	    {
+	      static const struct locarhead nullhead =
+		{
+		  .namehash_used = 0,
+		  .namehash_offset = 0,
+		  .namehash_size = 0
+		};
+
+	      ah->addr = (void *) &nullhead;
+	      ah->fd = -1;
+	    }
+	  else
+	    create_archive (archivefname, ah);
+
 	  return;
 	}
       else
@@ -368,7 +382,7 @@ open_archive (struct locarhandle *ah)
     error (EXIT_FAILURE, errno, _("cannot stat locale archive \"%s\""),
 	   archivefname);
 
-  if (lockf64 (fd, F_LOCK, st.st_size) == -1)
+  if (!readonly && lockf64 (fd, F_LOCK, sizeof (struct locarhead)) == -1)
     {
       close (fd);
 
@@ -394,13 +408,17 @@ open_archive (struct locarhandle *ah)
       || st.st_dev != st2.st_dev
       || st.st_ino != st2.st_ino)
     {
+      (void) lockf64 (fd, F_ULOCK, sizeof (struct locarhead));
       close (fd);
       goto again;
     }
 
   /* Read the header.  */
   if (TEMP_FAILURE_RETRY (read (fd, &head, sizeof (head))) != sizeof (head))
-    error (EXIT_FAILURE, errno, _("cannot read archive header"));
+    {
+      (void) lockf64 (fd, F_ULOCK, sizeof (struct locarhead));
+      error (EXIT_FAILURE, errno, _("cannot read archive header"));
+    }
 
   ah->fd = fd;
   ah->len = (head.sumhash_offset
@@ -408,17 +426,24 @@ open_archive (struct locarhandle *ah)
 
   /* Now we know how large the administrative information part is.
      Map all of it.  */
-  ah->addr = mmap64 (NULL, ah->len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
+  ah->addr = mmap64 (NULL, ah->len, PROT_READ | (readonly ? 0 : PROT_WRITE),
+		     MAP_SHARED, fd, 0);
   if (ah->addr == MAP_FAILED)
-    error (EXIT_FAILURE, errno, _("cannot map archive header"));
+    {
+      (void) lockf64 (fd, F_ULOCK, sizeof (struct locarhead));
+      error (EXIT_FAILURE, errno, _("cannot map archive header"));
+    }
 }
 
 
 void
 close_archive (struct locarhandle *ah)
 {
-  munmap (ah->addr, ah->len);
-  close (ah->fd);
+  if (ah->fd != -1)
+    {
+      munmap (ah->addr, ah->len);
+      close (ah->fd);
+    }
 }
 
 
@@ -648,7 +673,7 @@ add_locales_to_archive (nlist, list, replace)
 
   /* Open the archive.  This call never returns if we cannot
      successfully open the archive.  */
-  open_archive (&ah);
+  open_archive (&ah, false);
 
   while (nlist-- > 0)
     {
@@ -847,7 +872,7 @@ delete_locales_from_archive (nlist, list)
 
   /* Open the archive.  This call never returns if we cannot
      successfully open the archive.  */
-  open_archive (&ah);
+  open_archive (&ah, false);
 
   head = ah.addr;
   namehashtab = (struct namehashent *) ((char *) ah.addr
@@ -897,30 +922,62 @@ delete_locales_from_archive (nlist, list)
 }
 
 
+struct nameent
+{
+  char *name;
+  uint32_t locrec_offset;
+};
+
+
+struct dataent
+{
+  const unsigned char *sum;
+  uint32_t file_offset;
+  uint32_t nlink;
+};
+
+
+static int
+nameentcmp (const void *a, const void *b)
+{
+  return strcmp (((const struct nameent *) a)->name,
+		 ((const struct nameent *) b)->name);
+}
+
+
 static int
-xstrcmp (const void *a, const void *b)
+dataentcmp (const void *a, const void *b)
 {
-  return strcmp (*(const char **) a, *(const char **) b);
+  if (((const struct dataent *) a)->file_offset
+      < ((const struct dataent *) b)->file_offset)
+    return -1;
+
+  if (((const struct dataent *) a)->file_offset
+      > ((const struct dataent *) b)->file_offset)
+    return 1;
+
+  return 0;
 }
 
 
 void
-show_archive_content (void)
+show_archive_content (int verbose)
 {
   struct locarhandle ah;
   struct locarhead *head;
   struct namehashent *namehashtab;
+  struct nameent *names;
   int cnt;
-  char **names;
   int used;
 
   /* Open the archive.  This call never returns if we cannot
      successfully open the archive.  */
-  open_archive (&ah);
+  open_archive (&ah, true);
 
   head = ah.addr;
 
-  names = (char **) xmalloc (head->namehash_used * sizeof (char *));
+  names = (struct nameent *) xmalloc (head->namehash_used
+				      * sizeof (struct nameent));
 
   namehashtab = (struct namehashent *) ((char *) ah.addr
 					+ head->namehash_offset);
@@ -928,14 +985,91 @@ show_archive_content (void)
     if (namehashtab[cnt].locrec_offset != 0)
       {
 	assert (used < head->namehash_used);
-	names[used++] = ah.addr + namehashtab[cnt].name_offset;
+	names[used].name = ah.addr + namehashtab[cnt].name_offset;
+	names[used++].locrec_offset = namehashtab[cnt].locrec_offset;
       }
 
   /* Sort the names.  */
-  qsort (names, used, sizeof (char *), xstrcmp);
+  qsort (names, used, sizeof (struct nameent), nameentcmp);
+
+  if (verbose)
+    {
+      struct dataent *files;
+      struct sumhashent *sumhashtab;
+      int sumused;
+
+      files = (struct dataent *) xmalloc (head->sumhash_used
+					  * sizeof (struct sumhashent));
+
+      sumhashtab = (struct sumhashent *) ((char *) ah.addr
+					  + head->sumhash_offset);
+      for (cnt = sumused = 0; cnt < head->sumhash_size; ++cnt)
+	if (sumhashtab[cnt].file_offset != 0)
+	  {
+	    assert (sumused < head->sumhash_used);
+	    files[sumused].sum = (const unsigned char *) sumhashtab[cnt].sum;
+	    files[sumused].file_offset = sumhashtab[cnt].file_offset;
+	    files[sumused++].nlink = 0;
+	  }
+
+      /* Sort by file locations.  */
+      qsort (files, sumused, sizeof (struct dataent), dataentcmp);
+
+      /* Compute nlink fields.  */
+      for (cnt = 0; cnt < used; ++cnt)
+	{
+	  struct locrecent *locrec;
+	  int idx;
+
+	  locrec = (struct locrecent *) ((char *) ah.addr
+					 + names[cnt].locrec_offset);
+	  for (idx = 0; idx < __LC_LAST; ++idx)
+	    if (idx != LC_ALL)
+	      {
+		struct dataent *data, dataent;
+
+		dataent.file_offset = locrec->record[idx].offset;
+		data = (struct dataent *) bsearch (&dataent, files, sumused,
+						   sizeof (struct dataent),
+						   dataentcmp);
+		assert (data != NULL);
+		++data->nlink;
+	      }
+	}
 
-  for (cnt = 0; cnt < used; ++cnt)
-    puts (names[cnt]);
+      /* Print it.  */
+      for (cnt = 0; cnt < used; ++cnt)
+	{
+	  struct locrecent *locrec;
+	  int idx, i;
+
+	  locrec = (struct locrecent *) ((char *) ah.addr
+					 + names[cnt].locrec_offset);
+	  for (idx = 0; idx < __LC_LAST; ++idx)
+	    if (idx != LC_ALL)
+	      {
+		struct dataent *data, dataent;
+
+		dataent.file_offset = locrec->record[idx].offset;
+		data = (struct dataent *) bsearch (&dataent, files, sumused,
+						   sizeof (struct dataent),
+						   dataentcmp);
+		printf ("%6d %7x %3d ",
+			locrec->record[idx].len, locrec->record[idx].offset,
+			data->nlink);
+		for (i = 0; i < 16; i += 4)
+		    printf ("%02x%02x%02x%02x",
+			    data->sum[i], data->sum[i + 1],
+			    data->sum[i + 2], data->sum[i + 3]);
+		printf (" %s/%s\n", names[cnt].name,
+			idx == LC_MESSAGES ? "LC_MESSAGES/SYS_LC_MESSAGES"
+			: locnames[idx]);
+	      }
+	}
+    }
+  else
+    for (cnt = 0; cnt < used; ++cnt)
+      puts (names[cnt].name);
 
   close_archive (&ah);
 
diff --git a/locale/programs/locfile.c b/locale/programs/locfile.c
index 4d978d12a1..389adf1ee3 100644
--- a/locale/programs/locfile.c
+++ b/locale/programs/locfile.c
@@ -337,7 +337,7 @@ write_all_categories (struct localedef_t *definitions,
 
       /* Open the archive.  This call never returns if we cannot
 	 successfully open the archive.  */
-      open_archive (&ah);
+      open_archive (&ah, false);
 
       if (add_locale_to_archive (&ah, locname, to_archive, true) != 0)
 	error (EXIT_FAILURE, errno, _("cannot add to locale archive"));
diff --git a/malloc/malloc.c b/malloc/malloc.c
index 4057f56132..d588941159 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -5273,6 +5273,7 @@ int mALLOPt(param_number, value) int param_number; int value;
 
 
 #ifdef _LIBC
+# include <sys/param.h>
 
 /* We need a wrapper function for one of the additions of POSIX.  */
 int
@@ -5282,7 +5283,7 @@ __posix_memalign (void **memptr, size_t alignment, size_t size)
 
   /* Test whether the SIZE argument is valid.  It must be a power of
      two multiple of sizeof (void *).  */
-  if (size % sizeof (void *) != 0 || (size & (size - 1)) != 0)
+  if (alignment % sizeof (void *) != 0 || !powerof2 (alignment) != 0)
     return EINVAL;
 
   mem = __libc_memalign (alignment, size);
diff --git a/sunrpc/auth_des.c b/sunrpc/auth_des.c
index bf1b8a6eeb..fc5956dcd7 100644
--- a/sunrpc/auth_des.c
+++ b/sunrpc/auth_des.c
@@ -115,7 +115,7 @@ authdes_create (const char *servername, u_int window,
 
   pkey.n_bytes = (char *) pkey_data;
   pkey.n_len = strlen ((char *) pkey_data) + 1;
-  return authdes_pk_create (servername, &pkey, window, syncaddr, ckey);
+  return INTUSE(authdes_pk_create) (servername, &pkey, window, syncaddr, ckey);
 }
 
 AUTH *
@@ -206,6 +206,7 @@ failed:
     }
   return NULL;
 }
+INTDEF(authdes_pk_create)
 
 /*
  * Implement the five authentication operations
diff --git a/sunrpc/auth_none.c b/sunrpc/auth_none.c
index 4a1b46f274..9c4d3fde66 100644
--- a/sunrpc/auth_none.c
+++ b/sunrpc/auth_none.c
@@ -96,6 +96,7 @@ authnone_create (void)
   __libc_once (authnone_private_guard, authnone_create_once);
   return &authnone_private.no_client;
 }
+INTDEF (authnone_create)
 
 static bool_t
 authnone_marshal (AUTH *client, XDR *xdrs)
diff --git a/sunrpc/auth_unix.c b/sunrpc/auth_unix.c
index aae372c4fb..8c1134fba4 100644
--- a/sunrpc/auth_unix.c
+++ b/sunrpc/auth_unix.c
@@ -156,6 +156,7 @@ no_memory:
   marshal_new_auth (auth);
   return auth;
 }
+INTDEF (authunix_create)
 
 /*
  * Returns an auth handle with parameters determined by doing lots of
@@ -182,8 +183,9 @@ authunix_create_default (void)
   /* This braindamaged Sun code forces us here to truncate the
      list of groups to NGRPS members since the code in
      authuxprot.c transforms a fixed array.  Grrr.  */
-  return authunix_create (machname, uid, gid, MIN (NGRPS, len), gids);
+  return INTUSE(authunix_create) (machname, uid, gid, MIN (NGRPS, len), gids);
 }
+INTDEF (authunix_create_default)
 
 /*
  * authunix operations
diff --git a/sunrpc/bindrsvprt.c b/sunrpc/bindrsvprt.c
index 0acfd69e09..ba3309a4b3 100644
--- a/sunrpc/bindrsvprt.c
+++ b/sunrpc/bindrsvprt.c
@@ -78,8 +78,9 @@ bindresvport (int sd, struct sockaddr_in *sin)
 	{
 	  port = STARTPORT;
 	}
-      res = bind (sd, sin, sizeof (struct sockaddr_in));
+      res = __bind (sd, sin, sizeof (struct sockaddr_in));
     }
 
   return res;
 }
+INTDEF (bindresvport)
diff --git a/sunrpc/clnt_gen.c b/sunrpc/clnt_gen.c
index 251ad88ee5..bd5545025d 100644
--- a/sunrpc/clnt_gen.c
+++ b/sunrpc/clnt_gen.c
@@ -66,7 +66,7 @@ clnt_create (const char *hostname, u_long prog, u_long vers,
       sun.sun_family = AF_UNIX;
       strcpy (sun.sun_path, hostname);
       sock = RPC_ANYSOCK;
-      client = clntunix_create (&sun, prog, vers, &sock, 0, 0);
+      client = INTUSE(clntunix_create) (&sun, prog, vers, &sock, 0, 0);
       if (client == NULL)
 	return NULL;
 #if 0
@@ -136,7 +136,7 @@ clnt_create (const char *hostname, u_long prog, u_long vers,
     case IPPROTO_UDP:
       tv.tv_sec = 5;
       tv.tv_usec = 0;
-      client = clntudp_create (&sin, prog, vers, tv, &sock);
+      client = INTUSE(clntudp_create) (&sin, prog, vers, tv, &sock);
       if (client == NULL)
 	{
 	  return NULL;
@@ -150,7 +150,7 @@ clnt_create (const char *hostname, u_long prog, u_long vers,
 #endif
       break;
     case IPPROTO_TCP:
-      client = clnttcp_create (&sin, prog, vers, &sock, 0, 0);
+      client = INTUSE(clnttcp_create) (&sin, prog, vers, &sock, 0, 0);
       if (client == NULL)
 	{
 	  return NULL;
@@ -174,3 +174,4 @@ clnt_create (const char *hostname, u_long prog, u_long vers,
     }
   return client;
 }
+INTDEF (clnt_create)
diff --git a/sunrpc/clnt_raw.c b/sunrpc/clnt_raw.c
index 110141fcc8..082a76abeb 100644
--- a/sunrpc/clnt_raw.c
+++ b/sunrpc/clnt_raw.c
@@ -128,7 +128,7 @@ clntraw_create (u_long prog, u_long vers)
    * create client handle
    */
   client->cl_ops = &client_ops;
-  client->cl_auth = authnone_create ();
+  client->cl_auth = INTUSE(authnone_create) ();
   return client;
 }
 
@@ -170,7 +170,7 @@ call_again:
    * We have to call server input routine here because this is
    * all going on in one process. Yuk.
    */
-  svc_getreq (1);
+  INTUSE(svc_getreq) (1);
 
   /*
    * get results
diff --git a/sunrpc/clnt_simp.c b/sunrpc/clnt_simp.c
index 5c11b479b2..373eeed1a6 100644
--- a/sunrpc/clnt_simp.c
+++ b/sunrpc/clnt_simp.c
@@ -125,7 +125,7 @@ callrpc (const char *host, u_long prognum, u_long versnum, u_long procnum,
       memcpy ((char *) &server_addr.sin_addr, hp->h_addr, hp->h_length);
       server_addr.sin_family = AF_INET;
       server_addr.sin_port = 0;
-      if ((crp->client = clntudp_create (&server_addr, (u_long) prognum,
+      if ((crp->client = INTUSE(clntudp_create) (&server_addr, (u_long) prognum,
 			  (u_long) versnum, timeout, &crp->socket)) == NULL)
 	return (int) get_rpc_createerr().cf_stat;
       crp->valid = 1;
diff --git a/sunrpc/clnt_tcp.c b/sunrpc/clnt_tcp.c
index 8c09a15c66..5d02cd99cb 100644
--- a/sunrpc/clnt_tcp.c
+++ b/sunrpc/clnt_tcp.c
@@ -201,7 +201,7 @@ clnttcp_create (struct sockaddr_in *raddr, u_long prog, u_long vers,
    * pre-serialize the static part of the call msg and stash it away
    */
   INTUSE(xdrmem_create) (&(ct->ct_xdrs), ct->ct_mcall, MCALL_MSG_SIZE,
-		 XDR_ENCODE);
+			 XDR_ENCODE);
   if (!INTUSE(xdr_callhdr) (&(ct->ct_xdrs), &call_msg))
     {
       if (ct->ct_closeit)
@@ -221,7 +221,7 @@ clnttcp_create (struct sockaddr_in *raddr, u_long prog, u_long vers,
 			 (caddr_t) ct, readtcp, writetcp);
   h->cl_ops = &tcp_ops;
   h->cl_private = (caddr_t) ct;
-  h->cl_auth = authnone_create ();
+  h->cl_auth = INTUSE(authnone_create) ();
   return h;
 
 fooy:
@@ -232,6 +232,7 @@ fooy:
   mem_free ((caddr_t) h, sizeof (CLIENT));
   return ((CLIENT *) NULL);
 }
+INTDEF (clnttcp_create)
 
 static enum clnt_stat
 clnttcp_call (h, proc, xdr_args, args_ptr, xdr_results, results_ptr, timeout)
diff --git a/sunrpc/clnt_udp.c b/sunrpc/clnt_udp.c
index 82fd3eee51..8f6d269db6 100644
--- a/sunrpc/clnt_udp.c
+++ b/sunrpc/clnt_udp.c
@@ -191,13 +191,13 @@ clntudp_bufcreate (struct sockaddr_in *raddr, u_long program, u_long version,
 	  goto fooy;
 	}
       /* attempt to bind to prov port */
-      (void) bindresvport (*sockp, (struct sockaddr_in *) 0);
+      (void) INTUSE(bindresvport) (*sockp, (struct sockaddr_in *) 0);
       /* the sockets rpc controls are non-blocking */
       (void) __ioctl (*sockp, FIONBIO, (char *) &dontblock);
 #ifdef IP_RECVERR
       {
 	int on = 1;
-	setsockopt(*sockp, SOL_IP, IP_RECVERR, &on, sizeof(on));
+	__setsockopt (*sockp, SOL_IP, IP_RECVERR, &on, sizeof(on));
       }
 #endif
       cu->cu_closeit = TRUE;
@@ -207,7 +207,7 @@ clntudp_bufcreate (struct sockaddr_in *raddr, u_long program, u_long version,
       cu->cu_closeit = FALSE;
     }
   cu->cu_sock = *sockp;
-  cl->cl_auth = authnone_create ();
+  cl->cl_auth = INTUSE(authnone_create) ();
   return cl;
 fooy:
   if (cu)
@@ -216,6 +216,7 @@ fooy:
     mem_free ((caddr_t) cl, sizeof (CLIENT));
   return (CLIENT *) NULL;
 }
+INTDEF (clntudp_bufcreate)
 
 CLIENT *
 clntudp_create (raddr, program, version, wait, sockp)
@@ -225,10 +226,10 @@ clntudp_create (raddr, program, version, wait, sockp)
      struct timeval wait;
      int *sockp;
 {
-
-  return clntudp_bufcreate (raddr, program, version, wait, sockp,
-			    UDPMSGSIZE, UDPMSGSIZE);
+  return INTUSE(clntudp_bufcreate) (raddr, program, version, wait, sockp,
+				    UDPMSGSIZE, UDPMSGSIZE);
 }
+INTDEF (clntudp_create)
 
 static int
 is_network_up (int sock)
@@ -312,8 +313,8 @@ call_again:
   outlen = (int) XDR_GETPOS (xdrs);
 
 send_again:
-  if (sendto (cu->cu_sock, cu->cu_outbuf, outlen, 0,
-	      (struct sockaddr *) &(cu->cu_raddr), cu->cu_rlen)
+  if (__sendto (cu->cu_sock, cu->cu_outbuf, outlen, 0,
+		(struct sockaddr *) &(cu->cu_raddr), cu->cu_rlen)
       != outlen)
     {
       cu->cu_error.re_errno = errno;
@@ -395,7 +396,7 @@ send_again:
 	  msg.msg_flags = 0;
 	  msg.msg_control = cbuf;
 	  msg.msg_controllen = 256;
-	  ret = recvmsg (cu->cu_sock, &msg, MSG_ERRQUEUE);
+	  ret = __recvmsg (cu->cu_sock, &msg, MSG_ERRQUEUE);
 	  if (ret >= 0
 	      && memcmp (cbuf + 256, cu->cu_outbuf, ret) == 0
 	      && (msg.msg_flags & MSG_ERRQUEUE)
@@ -419,9 +420,9 @@ send_again:
       do
 	{
 	  fromlen = sizeof (struct sockaddr);
-	  inlen = recvfrom (cu->cu_sock, cu->cu_inbuf,
-			    (int) cu->cu_recvsz, 0,
-			    (struct sockaddr *) &from, &fromlen);
+	  inlen = __recvfrom (cu->cu_sock, cu->cu_inbuf,
+			      (int) cu->cu_recvsz, 0,
+			      (struct sockaddr *) &from, &fromlen);
 	}
       while (inlen < 0 && errno == EINTR);
       if (inlen < 0)
diff --git a/sunrpc/clnt_unix.c b/sunrpc/clnt_unix.c
index 8c2fa40f80..fae1cd8229 100644
--- a/sunrpc/clnt_unix.c
+++ b/sunrpc/clnt_unix.c
@@ -200,7 +200,7 @@ clntunix_create (struct sockaddr_un *raddr, u_long prog, u_long vers,
 			 (caddr_t) ct, readunix, writeunix);
   h->cl_ops = &unix_ops;
   h->cl_private = (caddr_t) ct;
-  h->cl_auth = authnone_create ();
+  h->cl_auth = INTUSE(authnone_create) ();
   return h;
 
 fooy:
@@ -211,6 +211,7 @@ fooy:
   mem_free ((caddr_t) h, sizeof (CLIENT));
   return (CLIENT *) NULL;
 }
+INTDEF (clntunix_create)
 
 static enum clnt_stat
 clntunix_call (h, proc, xdr_args, args_ptr, xdr_results, results_ptr, timeout)
@@ -466,13 +467,13 @@ __msgread (int sock, void *data, size_t cnt)
 #ifdef SO_PASSCRED
   {
     int on = 1;
-    if (setsockopt (sock, SOL_SOCKET, SO_PASSCRED, &on, sizeof (on)))
+    if (__setsockopt (sock, SOL_SOCKET, SO_PASSCRED, &on, sizeof (on)))
       return -1;
   }
 #endif
 
  restart:
-  len = recvmsg (sock, &msg, 0);
+  len = __recvmsg (sock, &msg, 0);
   if (len >= 0)
     {
       if (msg.msg_flags & MSG_CTRUNC || len == 0)
@@ -523,7 +524,7 @@ __msgwrite (int sock, void *data, size_t cnt)
   msg.msg_flags = 0;
 
  restart:
-  len = sendmsg (sock, &msg, 0);
+  len = __sendmsg (sock, &msg, 0);
   if (len >= 0)
     return len;
   if (errno == EINTR)
diff --git a/sunrpc/key_call.c b/sunrpc/key_call.c
index 61c13ec335..93117fd03f 100644
--- a/sunrpc/key_call.c
+++ b/sunrpc/key_call.c
@@ -215,9 +215,9 @@ key_gendes (des_block *key)
   sin.sin_addr.s_addr = htonl (INADDR_LOOPBACK);
   __bzero (sin.sin_zero, sizeof (sin.sin_zero));
   socket = RPC_ANYSOCK;
-  client = clntudp_bufcreate (&sin, (u_long) KEY_PROG, (u_long) KEY_VERS,
-			      trytimeout, &socket, RPCSMALLMSGSIZE,
-			      RPCSMALLMSGSIZE);
+  client = INTUSE(clntudp_bufcreate) (&sin, (u_long) KEY_PROG,
+				      (u_long) KEY_VERS, trytimeout, &socket,
+				      RPCSMALLMSGSIZE, RPCSMALLMSGSIZE);
   if (client == NULL)
     return -1;
 
@@ -425,7 +425,7 @@ getkeyserv_handle (int vers)
         kcp->uid = __geteuid ();
         auth_destroy (kcp->client->cl_auth);
         kcp->client->cl_auth =
-          authunix_create ((char *)"", kcp->uid, 0, 0, NULL);
+          INTUSE(authunix_create) ((char *)"", kcp->uid, 0, 0, NULL);
         if (kcp->client->cl_auth == NULL)
           {
             clnt_destroy (kcp->client);
@@ -440,14 +440,16 @@ getkeyserv_handle (int vers)
 
   if ((kcp->client == (CLIENT *) NULL))
     /* Use the AF_UNIX transport */
-    kcp->client = clnt_create ("/var/run/keyservsock", KEY_PROG, vers, "unix");
+    kcp->client = INTUSE(clnt_create) ("/var/run/keyservsock", KEY_PROG, vers,
+				       "unix");
 
   if (kcp->client == (CLIENT *) NULL)
     return (CLIENT *) NULL;
 
   kcp->uid = __geteuid ();
   kcp->pid = __getpid ();
-  kcp->client->cl_auth = authunix_create ((char *)"", kcp->uid, 0, 0, NULL);
+  kcp->client->cl_auth = INTUSE(authunix_create) ((char *)"", kcp->uid, 0, 0,
+						  NULL);
   if (kcp->client->cl_auth == NULL)
     {
       clnt_destroy (kcp->client);
diff --git a/sunrpc/pm_getmaps.c b/sunrpc/pm_getmaps.c
index 987ed5fe09..d1d4ca8769 100644
--- a/sunrpc/pm_getmaps.c
+++ b/sunrpc/pm_getmaps.c
@@ -63,8 +63,8 @@ pmap_getmaps (struct sockaddr_in *address)
   minutetimeout.tv_sec = 60;
   minutetimeout.tv_usec = 0;
   address->sin_port = htons (PMAPPORT);
-  client = clnttcp_create (address, PMAPPROG,
-			   PMAPVERS, &socket, 50, 500);
+  client = INTUSE(clnttcp_create) (address, PMAPPROG,
+				   PMAPVERS, &socket, 50, 500);
   if (client != (CLIENT *) NULL)
     {
       if (CLNT_CALL (client, PMAPPROC_DUMP, (xdrproc_t)INTUSE(xdr_void), NULL,
diff --git a/sunrpc/pm_getport.c b/sunrpc/pm_getport.c
index c26183d75c..cd65307ee9 100644
--- a/sunrpc/pm_getport.c
+++ b/sunrpc/pm_getport.c
@@ -66,8 +66,9 @@ pmap_getport (address, program, version, protocol)
   struct pmap parms;
 
   address->sin_port = htons (PMAPPORT);
-  client = clntudp_bufcreate (address, PMAPPROG,
-	      PMAPVERS, timeout, &socket, RPCSMALLMSGSIZE, RPCSMALLMSGSIZE);
+  client = INTUSE(clntudp_bufcreate) (address, PMAPPROG, PMAPVERS, timeout,
+				      &socket, RPCSMALLMSGSIZE,
+				      RPCSMALLMSGSIZE);
   if (client != (CLIENT *) NULL)
     {
       struct rpc_createerr *ce = &get_rpc_createerr ();
diff --git a/sunrpc/pmap_clnt.c b/sunrpc/pmap_clnt.c
index 6e2c035a69..fa9bbf9373 100644
--- a/sunrpc/pmap_clnt.c
+++ b/sunrpc/pmap_clnt.c
@@ -121,8 +121,9 @@ pmap_set (u_long program, u_long version, int protocol, u_short port)
 
   if (!__get_myaddress (&myaddress))
     return FALSE;
-  client = clntudp_bufcreate (&myaddress, PMAPPROG, PMAPVERS,
-			timeout, &socket, RPCSMALLMSGSIZE, RPCSMALLMSGSIZE);
+  client = INTUSE(clntudp_bufcreate) (&myaddress, PMAPPROG, PMAPVERS,
+				      timeout, &socket, RPCSMALLMSGSIZE,
+				      RPCSMALLMSGSIZE);
   if (client == (CLIENT *) NULL)
     return (FALSE);
   parms.pm_prog = program;
@@ -156,8 +157,9 @@ pmap_unset (u_long program, u_long version)
 
   if (!__get_myaddress (&myaddress))
     return FALSE;
-  client = clntudp_bufcreate (&myaddress, PMAPPROG, PMAPVERS,
-			timeout, &socket, RPCSMALLMSGSIZE, RPCSMALLMSGSIZE);
+  client = INTUSE(clntudp_bufcreate) (&myaddress, PMAPPROG, PMAPVERS,
+				      timeout, &socket, RPCSMALLMSGSIZE,
+				      RPCSMALLMSGSIZE);
   if (client == (CLIENT *) NULL)
     return FALSE;
   parms.pm_prog = program;
diff --git a/sunrpc/pmap_rmt.c b/sunrpc/pmap_rmt.c
index 2f7592eb8e..c02f546b36 100644
--- a/sunrpc/pmap_rmt.c
+++ b/sunrpc/pmap_rmt.c
@@ -84,7 +84,7 @@ pmap_rmtcall (addr, prog, vers, proc, xdrargs, argsp, xdrres, resp, tout, port_p
   enum clnt_stat stat;
 
   addr->sin_port = htons (PMAPPORT);
-  client = clntudp_create (addr, PMAPPROG, PMAPVERS, timeout, &socket);
+  client = INTUSE(clntudp_create) (addr, PMAPPROG, PMAPVERS, timeout, &socket);
   if (client != (CLIENT *) NULL)
     {
       a.prog = prog;
@@ -239,7 +239,7 @@ clnt_broadcast (prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult)
      resultproc_t eachresult;	/* call with each result obtained */
 {
   enum clnt_stat stat = RPC_FAILED;
-  AUTH *unix_auth = authunix_create_default ();
+  AUTH *unix_auth = INTUSE(authunix_create_default) ();
   XDR xdr_stream;
   XDR *xdrs = &xdr_stream;
   struct timeval t;
@@ -271,7 +271,7 @@ clnt_broadcast (prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult)
       goto done_broad;
     }
 #ifdef SO_BROADCAST
-  if (setsockopt (sock, SOL_SOCKET, SO_BROADCAST, &on, sizeof (on)) < 0)
+  if (__setsockopt (sock, SOL_SOCKET, SO_BROADCAST, &on, sizeof (on)) < 0)
     {
       perror (_("Cannot set socket option SO_BROADCAST"));
       stat = RPC_CANTSEND;
@@ -321,9 +321,9 @@ clnt_broadcast (prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult)
       for (i = 0; i < nets; i++)
 	{
 	  baddr.sin_addr = addrs[i];
-	  if (sendto (sock, outbuf, outlen, 0,
-		      (struct sockaddr *) &baddr,
-		      sizeof (struct sockaddr)) != outlen)
+	  if (__sendto (sock, outbuf, outlen, 0,
+			(struct sockaddr *) &baddr,
+			sizeof (struct sockaddr)) != outlen)
 	    {
 	      perror (_("Cannot send broadcast packet"));
 	      stat = RPC_CANTSEND;
@@ -357,8 +357,8 @@ clnt_broadcast (prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult)
 	}			/* end of poll results switch */
     try_again:
       fromlen = sizeof (struct sockaddr);
-      inlen = recvfrom (sock, inbuf, UDPMSGSIZE, 0,
-			(struct sockaddr *) &raddr, &fromlen);
+      inlen = __recvfrom (sock, inbuf, UDPMSGSIZE, 0,
+			  (struct sockaddr *) &raddr, &fromlen);
       if (inlen < 0)
 	{
 	  if (errno == EINTR)
diff --git a/sunrpc/rtime.c b/sunrpc/rtime.c
index 536d018c90..0c6d2effe0 100644
--- a/sunrpc/rtime.c
+++ b/sunrpc/rtime.c
@@ -96,8 +96,8 @@ rtime (struct sockaddr_in *addrp, struct rpc_timeval *timep,
   addrp->sin_port = htons (IPPORT_TIMESERVER);
   if (type == SOCK_DGRAM)
     {
-      res = sendto (s, (char *) &thetime, sizeof (thetime), 0,
-		    (struct sockaddr *) addrp, sizeof (*addrp));
+      res = __sendto (s, (char *) &thetime, sizeof (thetime), 0,
+		      (struct sockaddr *) addrp, sizeof (*addrp));
       if (res < 0)
 	{
 	  do_close (s);
@@ -117,8 +117,8 @@ rtime (struct sockaddr_in *addrp, struct rpc_timeval *timep,
 	  return (-1);
 	}
       fromlen = sizeof (from);
-      res = recvfrom (s, (char *) &thetime, sizeof (thetime), 0,
-		      (struct sockaddr *) &from, &fromlen);
+      res = __recvfrom (s, (char *) &thetime, sizeof (thetime), 0,
+			(struct sockaddr *) &from, &fromlen);
       do_close (s);
       if (res < 0)
 	return -1;
diff --git a/sunrpc/svc.c b/sunrpc/svc.c
index 5260634ae2..932813b1c6 100644
--- a/sunrpc/svc.c
+++ b/sunrpc/svc.c
@@ -192,6 +192,7 @@ pmap_it:
 
   return TRUE;
 }
+INTDEF (svc_register)
 
 /* Remove a service program from the callout list. */
 void
@@ -213,6 +214,7 @@ svc_unregister (rpcprog_t prog, rpcvers_t vers)
   /* now unregister the information with the local binder service */
   pmap_unset (prog, vers);
 }
+INTDEF (svc_unregister)
 
 /* ******************* REPLY GENERATION ROUTINES  ************ */
 
@@ -231,6 +233,7 @@ svc_sendreply (register SVCXPRT *xprt, xdrproc_t xdr_results,
   rply.acpted_rply.ar_results.proc = xdr_results;
   return SVC_REPLY (xprt, &rply);
 }
+INTDEF (svc_sendreply)
 
 /* No procedure error reply */
 void
@@ -257,6 +260,7 @@ svcerr_decode (register SVCXPRT *xprt)
   rply.acpted_rply.ar_stat = GARBAGE_ARGS;
   SVC_REPLY (xprt, &rply);
 }
+INTDEF (svcerr_decode)
 
 /* Some system error */
 void
@@ -345,8 +349,9 @@ svc_getreq (int rdfds)
 
   FD_ZERO (&readfds);
   readfds.fds_bits[0] = rdfds;
-  svc_getreqset (&readfds);
+  INTUSE(svc_getreqset) (&readfds);
 }
+INTDEF (svc_getreq)
 
 void
 svc_getreqset (fd_set *readfds)
@@ -361,8 +366,9 @@ svc_getreqset (fd_set *readfds)
   maskp = (u_int32_t *) readfds->fds_bits;
   for (sock = 0; sock < setsize; sock += 32)
     for (mask = *maskp++; (bit = ffs (mask)); mask ^= (1 << (bit - 1)))
-      svc_getreq_common (sock + bit - 1);
+      INTUSE(svc_getreq_common) (sock + bit - 1);
 }
+INTDEF (svc_getreqset)
 
 void
 svc_getreq_poll (struct pollfd *pfdp, int pollretval)
@@ -382,10 +388,11 @@ svc_getreq_poll (struct pollfd *pfdp, int pollretval)
 	  if (p->revents & POLLNVAL)
 	    xprt_unregister (xports[p->fd]);
 	  else
-	    svc_getreq_common (p->fd);
+	    INTUSE(svc_getreq_common) (p->fd);
 	}
     }
 }
+INTDEF (svc_getreq_poll)
 
 
 void
@@ -477,6 +484,7 @@ svc_getreq_common (const int fd)
     }
   while (stat == XPRT_MOREREQS);
 }
+INTDEF (svc_getreq_common)
 
 #ifdef _RPC_THREAD_SAFE_
 
diff --git a/sunrpc/svc_auth.c b/sunrpc/svc_auth.c
index f0aebd5358..68ed4f100b 100644
--- a/sunrpc/svc_auth.c
+++ b/sunrpc/svc_auth.c
@@ -111,6 +111,7 @@ _authenticate (register struct svc_req *rqst, struct rpc_msg *msg)
 
   return AUTH_REJECTEDCRED;
 }
+INTDEF(_authenticate)
 
 static enum auth_stat
 _svcauth_null (struct svc_req *rqst, struct rpc_msg *msg)
diff --git a/sunrpc/svc_run.c b/sunrpc/svc_run.c
index 72fb939e78..017910b453 100644
--- a/sunrpc/svc_run.c
+++ b/sunrpc/svc_run.c
@@ -79,7 +79,7 @@ svc_run (void)
 	  free (my_pollfd);
 	  continue;
 	default:
-	  svc_getreq_poll (my_pollfd, i);
+	  INTUSE(svc_getreq_poll) (my_pollfd, i);
 	  free (my_pollfd);
 	}
     }
diff --git a/sunrpc/svc_simple.c b/sunrpc/svc_simple.c
index dbdb8f1501..cd985a201a 100644
--- a/sunrpc/svc_simple.c
+++ b/sunrpc/svc_simple.c
@@ -91,7 +91,7 @@ registerrpc (u_long prognum, u_long versnum, u_long procnum,
     }
   if (transp == 0)
     {
-      transp = svcudp_create (RPC_ANYSOCK);
+      transp = INTUSE(svcudp_create) (RPC_ANYSOCK);
       if (transp == NULL)
 	{
 	  buf = strdup (_("couldn't create an rpc server\n"));
@@ -99,8 +99,8 @@ registerrpc (u_long prognum, u_long versnum, u_long procnum,
 	}
     }
   (void) pmap_unset ((u_long) prognum, (u_long) versnum);
-  if (!svc_register (transp, (u_long) prognum, (u_long) versnum,
-		     universal, IPPROTO_UDP))
+  if (!INTUSE(svc_register) (transp, (u_long) prognum, (u_long) versnum,
+			     universal, IPPROTO_UDP))
     {
       (void) __asprintf (&buf, _("couldn't register prog %ld vers %ld\n"),
 			 prognum, versnum);
@@ -146,8 +146,8 @@ universal (struct svc_req *rqstp, SVCXPRT *transp_l)
    */
   if (rqstp->rq_proc == NULLPROC)
     {
-      if (svc_sendreply (transp_l, (xdrproc_t)INTUSE(xdr_void), (char *) NULL)
-	  == FALSE)
+      if (INTUSE(svc_sendreply) (transp_l, (xdrproc_t)INTUSE(xdr_void),
+				 (char *) NULL) == FALSE)
 	{
 	  __write (STDERR_FILENO, "xxx\n", 4);
 	  exit (1);
@@ -163,14 +163,14 @@ universal (struct svc_req *rqstp, SVCXPRT *transp_l)
 	__bzero (xdrbuf, sizeof (xdrbuf));	/* required ! */
 	if (!svc_getargs (transp_l, pl->p_inproc, xdrbuf))
 	  {
-	    svcerr_decode (transp_l);
+	    INTUSE(svcerr_decode) (transp_l);
 	    return;
 	  }
 	outdata = (*(pl->p_progname)) (xdrbuf);
 	if (outdata == NULL && pl->p_outproc != (xdrproc_t)INTUSE(xdr_void))
 	  /* there was an error */
 	  return;
-	if (!svc_sendreply (transp_l, pl->p_outproc, outdata))
+	if (!INTUSE(svc_sendreply) (transp_l, pl->p_outproc, outdata))
 	  {
 	    (void) __asprintf (&buf,
 			       _("trouble replying to prog %d\n"),
diff --git a/sunrpc/svc_tcp.c b/sunrpc/svc_tcp.c
index 9416b7e78f..0a4a8a2601 100644
--- a/sunrpc/svc_tcp.c
+++ b/sunrpc/svc_tcp.c
@@ -160,13 +160,13 @@ svctcp_create (int sock, u_int sendsize, u_int recvsize)
     }
   __bzero ((char *) &addr, sizeof (addr));
   addr.sin_family = AF_INET;
-  if (bindresvport (sock, &addr))
+  if (INTUSE(bindresvport) (sock, &addr))
     {
       addr.sin_port = 0;
-      (void) bind (sock, (struct sockaddr *) &addr, len);
+      (void) __bind (sock, (struct sockaddr *) &addr, len);
     }
-  if ((getsockname (sock, (struct sockaddr *) &addr, &len) != 0) ||
-      (listen (sock, 2) != 0))
+  if ((__getsockname (sock, (struct sockaddr *) &addr, &len) != 0) ||
+      (__listen (sock, 2) != 0))
     {
       perror (_("svc_tcp.c - cannot getsockname or listen"));
       if (madesock)
diff --git a/sunrpc/svc_udp.c b/sunrpc/svc_udp.c
index 40de3c5e79..b42d6144b9 100644
--- a/sunrpc/svc_udp.c
+++ b/sunrpc/svc_udp.c
@@ -133,12 +133,12 @@ svcudp_bufcreate (sock, sendsz, recvsz)
     }
   __bzero ((char *) &addr, sizeof (addr));
   addr.sin_family = AF_INET;
-  if (bindresvport (sock, &addr))
+  if (INTUSE(bindresvport) (sock, &addr))
     {
       addr.sin_port = 0;
-      (void) bind (sock, (struct sockaddr *) &addr, len);
+      (void) __bind (sock, (struct sockaddr *) &addr, len);
     }
-  if (getsockname (sock, (struct sockaddr *) &addr, &len) != 0)
+  if (__getsockname (sock, (struct sockaddr *) &addr, &len) != 0)
     {
       perror (_("svcudp_create - cannot getsockname"));
       if (madesock)
@@ -188,8 +188,8 @@ svcudp_bufcreate (sock, sendsz, recvsz)
       return NULL;
     }
   pad = 1;
-  if (setsockopt (sock, SOL_IP, IP_PKTINFO, (void *) &pad,
-		  sizeof (pad)) == 0)
+  if (__setsockopt (sock, SOL_IP, IP_PKTINFO, (void *) &pad,
+		    sizeof (pad)) == 0)
     /* Set the padding to all 1s. */
     pad = 0xff;
   else
@@ -201,14 +201,15 @@ svcudp_bufcreate (sock, sendsz, recvsz)
   xprt_register (xprt);
   return xprt;
 }
+INTDEF (svcudp_bufcreate)
 
 SVCXPRT *
 svcudp_create (sock)
      int sock;
 {
-
-  return svcudp_bufcreate (sock, UDPMSGSIZE, UDPMSGSIZE);
+  return INTUSE(svcudp_bufcreate) (sock, UDPMSGSIZE, UDPMSGSIZE);
 }
+INTDEF (svcudp_create)
 
 static enum xprt_stat
 svcudp_stat (xprt)
@@ -256,15 +257,15 @@ again:
 					  + sizeof (struct msghdr)];
       mesgp->msg_controllen = sizeof(xprt->xp_pad)
 			      - sizeof (struct iovec) - sizeof (struct msghdr);
-      rlen = recvmsg (xprt->xp_sock, mesgp, 0);
+      rlen = __recvmsg (xprt->xp_sock, mesgp, 0);
       if (rlen >= 0)
 	len = mesgp->msg_namelen;
     }
   else
 #endif
-    rlen = recvfrom (xprt->xp_sock, rpc_buffer (xprt),
-		     (int) su->su_iosz, 0,
-		     (struct sockaddr *) &(xprt->xp_raddr), &len);
+    rlen = __recvfrom (xprt->xp_sock, rpc_buffer (xprt),
+		       (int) su->su_iosz, 0,
+		       (struct sockaddr *) &(xprt->xp_raddr), &len);
   xprt->xp_addrlen = len;
   if (rlen == -1 && errno == EINTR)
     goto again;
@@ -284,12 +285,12 @@ again:
 	    {
 	      iovp->iov_base = reply;
 	      iovp->iov_len = replylen;
-	      (void) sendmsg (xprt->xp_sock, mesgp, 0);
+	      (void) __sendmsg (xprt->xp_sock, mesgp, 0);
 	    }
 	  else
 #endif
-	    (void) sendto (xprt->xp_sock, reply, (int) replylen, 0,
-			   (struct sockaddr *) &xprt->xp_raddr, len);
+	    (void) __sendto (xprt->xp_sock, reply, (int) replylen, 0,
+			     (struct sockaddr *) &xprt->xp_raddr, len);
 	  return TRUE;
 	}
     }
@@ -323,13 +324,13 @@ svcudp_reply (xprt, msg)
 	  iovp = (struct iovec *) &xprt->xp_pad [0];
 	  iovp->iov_base = rpc_buffer (xprt);
 	  iovp->iov_len = slen;
-	  sent = sendmsg (xprt->xp_sock, mesgp, 0);
+	  sent = __sendmsg (xprt->xp_sock, mesgp, 0);
 	}
       else
 #endif
-	sent = sendto (xprt->xp_sock, rpc_buffer (xprt), slen, 0,
-		       (struct sockaddr *) &(xprt->xp_raddr),
-		       xprt->xp_addrlen);
+	sent = __sendto (xprt->xp_sock, rpc_buffer (xprt), slen, 0,
+			 (struct sockaddr *) &(xprt->xp_raddr),
+			 xprt->xp_addrlen);
       if (sent == slen)
 	{
 	  stat = TRUE;
diff --git a/sunrpc/svc_unix.c b/sunrpc/svc_unix.c
index afe4494a36..cfbc63866b 100644
--- a/sunrpc/svc_unix.c
+++ b/sunrpc/svc_unix.c
@@ -158,10 +158,10 @@ svcunix_create (int sock, u_int sendsize, u_int recvsize, char *path)
   memcpy (addr.sun_path, path, len);
   len += sizeof (addr.sun_family);
 
-  bind (sock, (struct sockaddr *) &addr, len);
+  __bind (sock, (struct sockaddr *) &addr, len);
 
-  if (getsockname (sock, (struct sockaddr *) &addr, &len) != 0
-      || listen (sock, 2) != 0)
+  if (__getsockname (sock, (struct sockaddr *) &addr, &len) != 0
+      || __listen (sock, 2) != 0)
     {
       perror (_("svc_unix.c - cannot getsockname or listen"));
       if (madesock)
@@ -334,13 +334,13 @@ __msgread (int sock, void *data, size_t cnt)
 #ifdef SO_PASSCRED
   {
     int on = 1;
-    if (setsockopt (sock, SOL_SOCKET, SO_PASSCRED, &on, sizeof (on)))
+    if (__setsockopt (sock, SOL_SOCKET, SO_PASSCRED, &on, sizeof (on)))
       return -1;
   }
 #endif
 
  restart:
-  len = recvmsg (sock, &msg, 0);
+  len = __recvmsg (sock, &msg, 0);
   if (len >= 0)
     {
       if (msg.msg_flags & MSG_CTRUNC || len == 0)
@@ -391,7 +391,7 @@ __msgwrite (int sock, void *data, size_t cnt)
   msg.msg_flags = 0;
 
  restart:
-  len = sendmsg (sock, &msg, 0);
+  len = __sendmsg (sock, &msg, 0);
   if (len >= 0)
     return len;
   if (errno == EINTR)
diff --git a/sysdeps/generic/bind.c b/sysdeps/generic/bind.c
index f51b1d8bc1..382e29db16 100644
--- a/sysdeps/generic/bind.c
+++ b/sysdeps/generic/bind.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996, 1997, 2002 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
@@ -21,7 +21,7 @@
 
 /* Give the socket FD the local address ADDR (which is LEN bytes long).  */
 int
-bind (fd, addr, len)
+__bind (fd, addr, len)
      int fd;
      __CONST_SOCKADDR_ARG addr;
      socklen_t len;
@@ -30,6 +30,7 @@ bind (fd, addr, len)
   return -1;
 }
 
+weak_alias (__bind, bind)
 
 stub_warning (bind)
 #include <stub-tag.h>
diff --git a/sysdeps/generic/getsockname.c b/sysdeps/generic/getsockname.c
index f27fa324af..b698bdbb7a 100644
--- a/sysdeps/generic/getsockname.c
+++ b/sysdeps/generic/getsockname.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996, 1997, 2002 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
@@ -21,7 +21,7 @@
 
 /* Put the local address of FD into *ADDR and its length in *LEN.  */
 int
-getsockname (fd, addr, len)
+__getsockname (fd, addr, len)
      int fd;
      __SOCKADDR_ARG addr;
      socklen_t *len;
@@ -30,6 +30,7 @@ getsockname (fd, addr, len)
   return -1;
 }
 
+weak_alias (__getsockname, getsockname)
 
 stub_warning (getsockname)
 #include <stub-tag.h>
diff --git a/sysdeps/generic/listen.c b/sysdeps/generic/listen.c
index 87484fecb1..cbdd8b9d18 100644
--- a/sysdeps/generic/listen.c
+++ b/sysdeps/generic/listen.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1995, 1996, 1997, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1991,1995,1996,1997,2001,2002 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
@@ -23,7 +23,7 @@
    N connection requests will be queued before further requests are refused.
    Returns 0 on success, -1 for errors.  */
 int
-listen (fd, n)
+__listen (fd, n)
      int fd;
      int n;
 {
@@ -31,6 +31,7 @@ listen (fd, n)
   return -1;
 }
 
+weak_alias (__listen, listen)
 
 stub_warning (listen)
 #include <stub-tag.h>
diff --git a/sysdeps/generic/recvfrom.c b/sysdeps/generic/recvfrom.c
index da6cc79a01..4f6a045077 100644
--- a/sysdeps/generic/recvfrom.c
+++ b/sysdeps/generic/recvfrom.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1995, 1996, 1997, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1991,1995,1996,1997,2001,2002 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
@@ -23,7 +23,7 @@
    at address ADDR (which is ADDR_LEN bytes long).
    Returns the number read or -1 for errors.  */
 ssize_t
-recvfrom (fd, buf, n, flags, addr, addr_len)
+__recvfrom (fd, buf, n, flags, addr, addr_len)
      int fd;
      void *buf;
      size_t n;
@@ -35,5 +35,7 @@ recvfrom (fd, buf, n, flags, addr, addr_len)
   return -1;
 }
 
+weak_alias (__recvfrom, recvfrom)
+
 stub_warning (recvfrom)
 #include <stub-tag.h>
diff --git a/sysdeps/generic/recvmsg.c b/sysdeps/generic/recvmsg.c
index 211b844d10..419415cd75 100644
--- a/sysdeps/generic/recvmsg.c
+++ b/sysdeps/generic/recvmsg.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1995, 1996, 1997, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1991,1995,1996,1997,2001,2002 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
@@ -22,7 +22,7 @@
 /* Receive a message as described by MESSAGE from socket FD.
    Returns the number of bytes read or -1 for errors.  */
 ssize_t
-recvmsg (fd, message, flags)
+__recvmsg (fd, message, flags)
      int fd;
      struct msghdr *message;
      int flags;
@@ -31,5 +31,7 @@ recvmsg (fd, message, flags)
   return -1;
 }
 
+weak_alias (__recvmsg, recvmsg)
+
 stub_warning (recvmsg)
 #include <stub-tag.h>
diff --git a/sysdeps/generic/sendmsg.c b/sysdeps/generic/sendmsg.c
index 36948f75bd..a4a3cea950 100644
--- a/sysdeps/generic/sendmsg.c
+++ b/sysdeps/generic/sendmsg.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1995, 1996, 1997, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1991,1995,1996,1997,2001,2002 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
@@ -22,7 +22,7 @@
 /* Send a message described MESSAGE on socket FD.
    Returns the number of bytes sent, or -1 for errors.  */
 ssize_t
-sendmsg (fd, message, flags)
+__sendmsg (fd, message, flags)
      int fd;
      const struct msghdr *message;
      int flags;
@@ -31,5 +31,7 @@ sendmsg (fd, message, flags)
   return -1;
 }
 
+weak_alias (__sendmsg, sendmsg)
+
 stub_warning (sendmsg)
 #include <stub-tag.h>
diff --git a/sysdeps/generic/sendto.c b/sysdeps/generic/sendto.c
index a9c0df9420..823c9dd1c7 100644
--- a/sysdeps/generic/sendto.c
+++ b/sysdeps/generic/sendto.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1995, 1996, 1997, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1991,1995,1996,1997,2001,2002 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
@@ -22,7 +22,7 @@
 /* Send N bytes of BUF on socket FD to peer at address ADDR (which is
    ADDR_LEN bytes long).  Returns the number sent, or -1 for errors.  */
 ssize_t
-sendto (fd, buf, n, flags, addr, addr_len)
+__sendto (fd, buf, n, flags, addr, addr_len)
      int fd;
      __const __ptr_t buf;
      size_t n;
@@ -34,5 +34,7 @@ sendto (fd, buf, n, flags, addr, addr_len)
   return -1;
 }
 
+weak_alias (__sendto, sendto)
+
 stub_warning (sendto)
 #include <stub-tag.h>
diff --git a/sysdeps/generic/setsockopt.c b/sysdeps/generic/setsockopt.c
index e33387ba01..aca73623fe 100644
--- a/sysdeps/generic/setsockopt.c
+++ b/sysdeps/generic/setsockopt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1991,1995,1996,1997,1998,2002 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
@@ -23,7 +23,7 @@
    to *OPTVAL (which is OPTLEN bytes long).
    Returns 0 on success, -1 for errors.  */
 int
-setsockopt (fd, level, optname, optval, optlen)
+__setsockopt (fd, level, optname, optval, optlen)
      int fd;
      int level;
      int optname;
@@ -34,5 +34,7 @@ setsockopt (fd, level, optname, optval, optlen)
   return -1;
 }
 
+weak_alias (__setsockopt, setsockopt)
+
 stub_warning (setsockopt)
 #include <stub-tag.h>
diff --git a/sysdeps/generic/unwind-dw2-fde.c b/sysdeps/generic/unwind-dw2-fde.c
index 3d1931868f..6c51c6f730 100644
--- a/sysdeps/generic/unwind-dw2-fde.c
+++ b/sysdeps/generic/unwind-dw2-fde.c
@@ -68,6 +68,13 @@ __libc_lock_define_initialized (static, object_mutex)
 #define __gthread_mutex_lock(m) __libc_lock_lock (*(m))
 #define __gthread_mutex_unlock(m) __libc_lock_unlock (*(m))
 
+void __register_frame_info_bases_internal (void *begin, struct object *ob,
+					   void *tbase, void *dbase);
+void __register_frame_info_table_bases_internal (void *begin,
+						 struct object *ob,
+						 void *tbase, void *dbase);
+void *__deregister_frame_info_bases_internal (void *begin);
+
 #else
 
 #ifdef __GTHREAD_MUTEX_INIT
@@ -120,11 +127,12 @@ __register_frame_info_bases (void *begin, struct object *ob,
 
   __gthread_mutex_unlock (&object_mutex);
 }
+INTDEF(__register_frame_info_bases)
 
 void
 __register_frame_info (void *begin, struct object *ob)
 {
-  __register_frame_info_bases (begin, ob, 0, 0);
+  INTUSE(__register_frame_info_bases) (begin, ob, 0, 0);
 }
 
 void
@@ -137,7 +145,7 @@ __register_frame (void *begin)
     return;
 
   ob = (struct object *) malloc (sizeof (struct object));
-  __register_frame_info (begin, ob);
+  INTUSE(__register_frame_info_bases) (begin, ob, 0, 0);
 }
 
 /* Similar, but BEGIN is actually a pointer to a table of unwind entries
@@ -164,18 +172,19 @@ __register_frame_info_table_bases (void *begin, struct object *ob,
 
   __gthread_mutex_unlock (&object_mutex);
 }
+INTDEF(__register_frame_info_table_bases)
 
 void
 __register_frame_info_table (void *begin, struct object *ob)
 {
-  __register_frame_info_table_bases (begin, ob, 0, 0);
+  INTUSE(__register_frame_info_table_bases) (begin, ob, 0, 0);
 }
 
 void
 __register_frame_table (void *begin)
 {
   struct object *ob = (struct object *) malloc (sizeof (struct object));
-  __register_frame_info_table (begin, ob);
+  INTUSE(__register_frame_info_table_bases) (begin, ob, 0, 0);
 }
 
 /* Called from crtbegin.o to deregister the unwind info for an object.  */
@@ -239,11 +248,12 @@ __deregister_frame_info_bases (void *begin)
   __gthread_mutex_unlock (&object_mutex);
   return (void *) ob;
 }
+INTDEF(__deregister_frame_info_bases)
 
 void *
 __deregister_frame_info (void *begin)
 {
-  return __deregister_frame_info_bases (begin);
+  return INTUSE(__deregister_frame_info_bases) (begin);
 }
 
 void
@@ -251,7 +261,7 @@ __deregister_frame (void *begin)
 {
   /* If .eh_frame is empty, we haven't registered.  */
   if (*(uword *)begin != 0)
-    free (__deregister_frame_info (begin));
+    free (INTUSE(__deregister_frame_info_bases) (begin));
 }
 
 
diff --git a/sysdeps/mach/hurd/bind.c b/sysdeps/mach/hurd/bind.c
index 8b08a6bafa..a42b78ac07 100644
--- a/sysdeps/mach/hurd/bind.c
+++ b/sysdeps/mach/hurd/bind.c
@@ -30,7 +30,7 @@
 
 /* Give the socket FD the local address ADDR (which is LEN bytes long).  */
 int
-bind  (int fd, __CONST_SOCKADDR_ARG addrarg, socklen_t len)
+__bind  (int fd, __CONST_SOCKADDR_ARG addrarg, socklen_t len)
 {
   addr_port_t aport;
   error_t err;
@@ -121,3 +121,5 @@ bind  (int fd, __CONST_SOCKADDR_ARG addrarg, socklen_t len)
 
   return err ? __hurd_dfail (fd, err) : 0;
 }
+
+weak_alias (__bind, bind)
diff --git a/sysdeps/mach/hurd/getsockname.c b/sysdeps/mach/hurd/getsockname.c
index 7c81ed52fd..dd0dddaed9 100644
--- a/sysdeps/mach/hurd/getsockname.c
+++ b/sysdeps/mach/hurd/getsockname.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1994, 1997, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1994, 1997, 1999, 2002 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
@@ -25,7 +25,7 @@
 
 /* Put the local address of FD into *ADDR and its length in *LEN.  */
 int
-getsockname (fd, addrarg, len)
+__getsockname (fd, addrarg, len)
      int fd;
      __SOCKADDR_ARG addrarg;
      socklen_t *len;
@@ -59,3 +59,5 @@ getsockname (fd, addrarg, len)
 
   return 0;
 }
+
+weak_alias (__getsockname, getsockname)
diff --git a/sysdeps/mach/hurd/listen.c b/sysdeps/mach/hurd/listen.c
index 46cb68af54..8ee2650bea 100644
--- a/sysdeps/mach/hurd/listen.c
+++ b/sysdeps/mach/hurd/listen.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1994, 1997, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1994, 1997, 2001, 2002 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
@@ -26,9 +26,8 @@
    N connection requests will be queued before further requests are refused.
    Returns 0 on success, -1 for errors.  */
 
-/* XXX should be __listen ? */
 int
-listen (fd, n)
+__listen (fd, n)
      int fd;
      int n;
 {
@@ -37,3 +36,5 @@ listen (fd, n)
     return __hurd_dfail (fd, err);
   return 0;
 }
+
+weak_alias (__listen, listen)
diff --git a/sysdeps/mach/hurd/recvfrom.c b/sysdeps/mach/hurd/recvfrom.c
index 8816ad44fc..d5c73f4441 100644
--- a/sysdeps/mach/hurd/recvfrom.c
+++ b/sysdeps/mach/hurd/recvfrom.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994, 1997, 1999, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1994, 1997, 1999, 2001, 2002 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,7 +28,7 @@
    the sender, and store the actual size of the address in *ADDR_LEN.
    Returns the number of bytes read or -1 for errors.  */
 ssize_t
-recvfrom (fd, buf, n, flags, addrarg, addr_len)
+__recvfrom (fd, buf, n, flags, addrarg, addr_len)
      int fd;
      void *buf;
      size_t n;
@@ -103,3 +103,5 @@ recvfrom (fd, buf, n, flags, addrarg, addr_len)
 
   return nread;
 }
+
+weak_alias (__recvfrom, recvfrom)
diff --git a/sysdeps/mach/hurd/recvmsg.c b/sysdeps/mach/hurd/recvmsg.c
index 73cd03c6d4..2878ef68c7 100644
--- a/sysdeps/mach/hurd/recvmsg.c
+++ b/sysdeps/mach/hurd/recvmsg.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2002 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
@@ -142,3 +142,4 @@ __libc_recvmsg (int fd, struct msghdr *message, int flags)
 }
 
 weak_alias (__libc_recvmsg, recvmsg)
+weak_alias (__libc_recvmsg, __recvmsg)
diff --git a/sysdeps/mach/hurd/sendmsg.c b/sysdeps/mach/hurd/sendmsg.c
index c55b559e29..9464d3f6c1 100644
--- a/sysdeps/mach/hurd/sendmsg.c
+++ b/sysdeps/mach/hurd/sendmsg.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2002 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
@@ -150,3 +150,4 @@ __libc_sendmsg (int fd, const struct msghdr *message, int flags)
 }
 
 weak_alias (__libc_sendmsg, sendmsg)
+weak_alias (__libc_sendmsg, __sendmsg)
diff --git a/sysdeps/mach/hurd/sendto.c b/sysdeps/mach/hurd/sendto.c
index 50bb77172c..0a6912a3b7 100644
--- a/sysdeps/mach/hurd/sendto.c
+++ b/sysdeps/mach/hurd/sendto.c
@@ -27,12 +27,12 @@
 /* Send N bytes of BUF on socket FD to peer at address ADDR (which is
    ADDR_LEN bytes long).  Returns the number sent, or -1 for errors.  */
 ssize_t
-sendto (int fd,
-	const void *buf,
-	size_t n,
-	int flags,
-	const struct sockaddr_un *addr,
-	socklen_t addr_len)
+__sendto (int fd,
+	  const void *buf,
+	  size_t n,
+	  int flags,
+	  const struct sockaddr_un *addr,
+	  socklen_t addr_len)
 {
   addr_port_t aport;
   error_t err;
@@ -81,3 +81,5 @@ sendto (int fd,
 
   return err ? __hurd_dfail (fd, err) : wrote;
 }
+
+weak_alias (__sendto, sendto)
diff --git a/sysdeps/mach/hurd/setsockopt.c b/sysdeps/mach/hurd/setsockopt.c
index 9875e96311..8ca7f0c724 100644
--- a/sysdeps/mach/hurd/setsockopt.c
+++ b/sysdeps/mach/hurd/setsockopt.c
@@ -25,13 +25,12 @@
 /* Set socket FD's option OPTNAME at protocol level LEVEL
    to *OPTVAL (which is OPTLEN bytes long).
    Returns 0 on success, -1 for errors.  */
-/* XXX __setsockopt ? */
 int
-setsockopt (int fd,
-	    int level,
-	    int optname,
-	    const void *optval,
-	    socklen_t optlen)
+__setsockopt (int fd,
+	      int level,
+	      int optname,
+	      const void *optval,
+	      socklen_t optlen)
 {
   error_t err = HURD_DPORT_USE (fd, __socket_setopt (port,
 						     level, optname,
@@ -40,3 +39,5 @@ setsockopt (int fd,
     return __hurd_dfail (fd, err);
   return 0;
 }
+
+weak_alias (__setsockopt, setsockopt)
diff --git a/sysdeps/unix/inet/syscalls.list b/sysdeps/unix/inet/syscalls.list
index 5a02f95f87..d01431d843 100644
--- a/sysdeps/unix/inet/syscalls.list
+++ b/sysdeps/unix/inet/syscalls.list
@@ -1,23 +1,23 @@
 # File name	Caller	Syscall name	# args	Strong name	Weak names
 
 accept		-	accept		i:iBN	__libc_accept	accept
-bind		-	bind		i:ipi	bind
+bind		-	bind		i:ipi	__bind		bind
 connect		-	connect		i:ipi	__libc_connect	__connect connect
 gethostid	-	gethostid	i:	gethostid
 gethostname	-	gethostname	i:bn	__gethostname	gethostname
 getpeername	-	getpeername	i:ibN	getpeername
 getsockname	-	getsockname	i:ibN	getsockname
 getsockopt	-	getsockopt	i:iiiBN	getsockopt
-listen		-	listen		i:ii	listen
+listen		-	listen		i:ii	__listen	listen
 recv		-	recv		i:ibni	__libc_recv	recv
-recvfrom	-	recvfrom	i:ibniBN	__libc_recvfrom	recvfrom
-recvmsg		-	recvmsg		i:ipi	__libc_recvmsg	recvmsg
+recvfrom	-	recvfrom	i:ibniBN	__libc_recvfrom __recvfrom recvfrom
+recvmsg		-	recvmsg		i:ipi	__libc_recvmsg	__recvmsg recvmsg
 send		-	send		i:ibni	__libc_send	__send send
-sendmsg		-	sendmsg		i:ipi	__libc_sendmsg	sendmsg
-sendto		-	sendto		i:ibnibn	__libc_sendto	sendto
+sendmsg		-	sendmsg		i:ipi	__libc_sendmsg	__sendmsg sendmsg
+sendto		-	sendto		i:ibnibn	__libc_sendto	__sendto sendto
 sethostid	-	sethostid	i:i	sethostid
 sethostname	-	sethostname	i:pi	sethostname
-setsockopt	-	setsockopt	i:iiibn	setsockopt
+setsockopt	-	setsockopt	i:iiibn	setsockopt	__setsockopt
 shutdown	-	shutdown	i:ii	shutdown
 socket		-	socket		i:iii	socket
 socketpair	-	socketpair	i:iiif	socketpair
diff --git a/sysdeps/unix/sysv/aix/getsockname.c b/sysdeps/unix/sysv/aix/getsockname.c
index 822f9e98cd..ac1bf34fcb 100644
--- a/sysdeps/unix/sysv/aix/getsockname.c
+++ b/sysdeps/unix/sysv/aix/getsockname.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2002 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
@@ -21,7 +21,9 @@
 extern int ngetsockname (int s, void *uap_asa, int *uap_alen);
 
 int
-getsockname (int fd, __SOCKADDR_ARG addr, socklen_t *len)
+__getsockname (int fd, __SOCKADDR_ARG addr, socklen_t *len)
 {
   return ngetsockname (fd, addr.__sockaddr__, len);
 }
+
+weak_alias (__getsockname, getsockname)
diff --git a/sysdeps/unix/sysv/aix/recvfrom.c b/sysdeps/unix/sysv/aix/recvfrom.c
index 08264288d1..08ff1113f4 100644
--- a/sysdeps/unix/sysv/aix/recvfrom.c
+++ b/sysdeps/unix/sysv/aix/recvfrom.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2000, 2001, 2002 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
@@ -22,8 +22,10 @@ extern ssize_t nrecvfrom (int s, void *uap_buf, size_t len, int flags,
 			  void *uap_from, socklen_t *uap_fromlenaddr);
 
 ssize_t
-recvfrom (int fd, void *buf, size_t n, int flags, __SOCKADDR_ARG addr,
-	  socklen_t *addr_len)
+__recvfrom (int fd, void *buf, size_t n, int flags, __SOCKADDR_ARG addr,
+	    socklen_t *addr_len)
 {
   return nrecvfrom (fd, buf, n, flags, addr.__sockaddr__, addr_len);
 }
+
+weak_alias (__recvfrom, recvfrom)
diff --git a/sysdeps/unix/sysv/aix/recvmsg.c b/sysdeps/unix/sysv/aix/recvmsg.c
index ea5af3557c..201c26741c 100644
--- a/sysdeps/unix/sysv/aix/recvmsg.c
+++ b/sysdeps/unix/sysv/aix/recvmsg.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2000, 2001, 2002 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
@@ -21,7 +21,9 @@
 extern ssize_t nrecvmsg (int s, struct msghdr *uap_msg, int flags);
 
 ssize_t
-recvmsg (int fd, struct msghdr *message, int flags)
+__recvmsg (int fd, struct msghdr *message, int flags)
 {
   return nrecvmsg (fd, message, flags);
 }
+
+weak_alias (__recvmsg, recvmsg)
diff --git a/sysdeps/unix/sysv/aix/sendmsg.c b/sysdeps/unix/sysv/aix/sendmsg.c
index 054d374393..5b1baf63a5 100644
--- a/sysdeps/unix/sysv/aix/sendmsg.c
+++ b/sysdeps/unix/sysv/aix/sendmsg.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2000, 2001, 2002 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
@@ -21,7 +21,10 @@
 extern int nsendmsg (int s, const void *uap_msg, int flags);
 
 ssize_t
-sendmsg (int fd, const struct msghdr *message, int flags)
+__sendmsg (int fd, const struct msghdr *message, int flags)
 {
   return nsendmsg (fd, message, flags);
 }
+
+weak_alias (__sendmsg, sendmsg)
+
diff --git a/sysdeps/unix/sysv/linux/alpha/syscalls.list b/sysdeps/unix/sysv/linux/alpha/syscalls.list
index eb64186134..3dc07341e3 100644
--- a/sysdeps/unix/sysv/linux/alpha/syscalls.list
+++ b/sysdeps/unix/sysv/linux/alpha/syscalls.list
@@ -43,10 +43,10 @@ getsockopt	-	getsockopt	5	__getsockopt	getsockopt
 listen		-	listen		2	__listen	listen
 recv		-	recv		4	__libc_recv	__recv recv
 recvfrom	-	recvfrom	6	__libc_recvfrom	__recvfrom recvfrom
-recvmsg		-	recvmsg		3	__libc_recvmsg	recvmsg
+recvmsg		-	recvmsg		3	__libc_recvmsg	__recvmsg recvmsg
 ptrace		-	ptrace		4	__ptrace	ptrace
 send		-	send		4	__libc_send	__send send
-sendmsg		-	sendmsg		3	__libc_sendmsg	sendmsg
+sendmsg		-	sendmsg		3	__libc_sendmsg	__sendmsg sendmsg
 sendto		-	sendto		6	__libc_sendto	__sendto sendto
 setsockopt	-	setsockopt	5	__setsockopt	setsockopt
 shutdown	-	shutdown	2	__shutdown	shutdown
diff --git a/sysdeps/unix/sysv/linux/bind.S b/sysdeps/unix/sysv/linux/bind.S
index 25ff7ecbfd..7719ad0be8 100644
--- a/sysdeps/unix/sysv/linux/bind.S
+++ b/sysdeps/unix/sysv/linux/bind.S
@@ -2,3 +2,4 @@
 #define	NARGS	3
 #define NO_WEAK_ALIAS	1
 #include <socket.S>
+weak_alias (bind, __bind)
diff --git a/sysdeps/unix/sysv/linux/getsockname.S b/sysdeps/unix/sysv/linux/getsockname.S
index 31d37a4f0a..9ea371ff6e 100644
--- a/sysdeps/unix/sysv/linux/getsockname.S
+++ b/sysdeps/unix/sysv/linux/getsockname.S
@@ -2,3 +2,4 @@
 #define	NARGS	3
 #define NO_WEAK_ALIAS	1
 #include <socket.S>
+weak_alias (getsockname, __getsockname)
diff --git a/sysdeps/unix/sysv/linux/hppa/syscalls.list b/sysdeps/unix/sysv/linux/hppa/syscalls.list
index 2c7a63917d..1c7a20d241 100644
--- a/sysdeps/unix/sysv/linux/hppa/syscalls.list
+++ b/sysdeps/unix/sysv/linux/hppa/syscalls.list
@@ -23,9 +23,9 @@ getsockopt	-	getsockopt	i:iiiBN	__getsockopt	getsockopt
 listen		-	listen		i:ii	__listen	listen
 recv		-	recv		i:ibni	__libc_recv	__recv recv
 recvfrom	-	recvfrom	i:ibniBN	__libc_recvfrom	__recvfrom recvfrom
-recvmsg		-	recvmsg		i:ipi	__libc_recvmsg	recvmsg
+recvmsg		-	recvmsg		i:ipi	__libc_recvmsg	__recvmsg recvmsg
 send		-	send		i:ibni	__libc_send	__send send
-sendmsg		-	sendmsg		i:ipi	__libc_sendmsg	sendmsg
+sendmsg		-	sendmsg		i:ipi	__libc_sendmsg	__sendmsg sendmsg
 sendto		-	sendto		i:ibnibn	__libc_sendto	__sendto sendto
 setsockopt	-	setsockopt	i:iiibn	__setsockopt	setsockopt
 shutdown	-	shutdown	i:ii	__shutdown	shutdown
diff --git a/sysdeps/unix/sysv/linux/ia64/syscalls.list b/sysdeps/unix/sysv/linux/ia64/syscalls.list
index f2bd5c0a81..15a93df618 100644
--- a/sysdeps/unix/sysv/linux/ia64/syscalls.list
+++ b/sysdeps/unix/sysv/linux/ia64/syscalls.list
@@ -39,9 +39,9 @@ getsockopt	-	getsockopt	i:iiiBN	__getsockopt	getsockopt
 listen		-	listen		i:ii	__listen	listen
 recv		-	recv		i:ibni	__libc_recv	__recv recv
 recvfrom	-	recvfrom	i:ibniBN	__libc_recvfrom	__recvfrom recvfrom
-recvmsg		-	recvmsg		i:ipi	__libc_recvmsg	recvmsg
+recvmsg		-	recvmsg		i:ipi	__libc_recvmsg	__recvmsg recvmsg
 send		-	send		i:ibni	__libc_send	__send send
-sendmsg		-	sendmsg		i:ipi	__libc_sendmsg	sendmsg
+sendmsg		-	sendmsg		i:ipi	__libc_sendmsg	__sendmsg sendmsg
 sendto		-	sendto		i:ibnibn	__libc_sendto	__sendto sendto
 setsockopt	-	setsockopt	i:iiibn	__setsockopt	setsockopt
 shutdown	-	shutdown	i:ii	__shutdown	shutdown
diff --git a/sysdeps/unix/sysv/linux/listen.S b/sysdeps/unix/sysv/linux/listen.S
index 115bf2b2d0..bed6a05f25 100644
--- a/sysdeps/unix/sysv/linux/listen.S
+++ b/sysdeps/unix/sysv/linux/listen.S
@@ -2,3 +2,4 @@
 #define	NARGS	2
 #define NO_WEAK_ALIAS	1
 #include <socket.S>
+weak_alias (listen, __listen)
diff --git a/sysdeps/unix/sysv/linux/recvfrom.S b/sysdeps/unix/sysv/linux/recvfrom.S
index 7d0e2b0ea8..93a3110d0a 100644
--- a/sysdeps/unix/sysv/linux/recvfrom.S
+++ b/sysdeps/unix/sysv/linux/recvfrom.S
@@ -2,3 +2,4 @@
 #define	__socket __libc_recvfrom
 #define	NARGS	6
 #include <socket.S>
+weak_alias (__libc_recvfrom, __recvfrom)
diff --git a/sysdeps/unix/sysv/linux/recvmsg.S b/sysdeps/unix/sysv/linux/recvmsg.S
index b4125d2caa..98be36be5b 100644
--- a/sysdeps/unix/sysv/linux/recvmsg.S
+++ b/sysdeps/unix/sysv/linux/recvmsg.S
@@ -2,3 +2,4 @@
 #define	__socket __libc_recvmsg
 #define	NARGS	3
 #include <socket.S>
+weak_alias (__libc_recvmsg, __recvmsg)
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list b/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list
index 1dbd61f2df..64f52cc02a 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list
@@ -34,9 +34,9 @@ getsockopt	-	getsockopt	i:iiiBN	__getsockopt	getsockopt
 listen		-	listen		i:ii	__listen	listen
 recv		-	recv		i:ibni	__libc_recv	__recv recv
 recvfrom	-	recvfrom	i:ibniBN	__libc_recvfrom	__recvfrom recvfrom
-recvmsg		-	recvmsg		i:ipi	__libc_recvmsg	recvmsg
+recvmsg		-	recvmsg		i:ipi	__libc_recvmsg	__recvmsg recvmsg
 send		-	send		i:ibni	__libc_send	__send send
-sendmsg		-	sendmsg		i:ipi	__libc_sendmsg	sendmsg
+sendmsg		-	sendmsg		i:ipi	__libc_sendmsg	__sendmsg sendmsg
 sendto		-	sendto		i:ibnibn	__libc_sendto	__sendto sendto
 setsockopt	-	setsockopt	i:iiibn	__setsockopt	setsockopt
 shutdown	-	shutdown	i:ii	__shutdown	shutdown
diff --git a/sysdeps/unix/sysv/linux/sendmsg.S b/sysdeps/unix/sysv/linux/sendmsg.S
index 0defce9f9e..c01d9b68e7 100644
--- a/sysdeps/unix/sysv/linux/sendmsg.S
+++ b/sysdeps/unix/sysv/linux/sendmsg.S
@@ -2,3 +2,4 @@
 #define	__socket __libc_sendmsg
 #define	NARGS	3
 #include <socket.S>
+weak_alias (__libc_sendmsg, __sendmsg)
diff --git a/sysdeps/unix/sysv/linux/sendto.S b/sysdeps/unix/sysv/linux/sendto.S
index f0acb88465..8717b2bac1 100644
--- a/sysdeps/unix/sysv/linux/sendto.S
+++ b/sysdeps/unix/sysv/linux/sendto.S
@@ -2,3 +2,4 @@
 #define	__socket __libc_sendto
 #define	NARGS	6
 #include <socket.S>
+weak_alias (__libc_sendto, __sendto)
diff --git a/sysdeps/unix/sysv/linux/setsockopt.S b/sysdeps/unix/sysv/linux/setsockopt.S
index 09d9109be2..4e40ccba57 100644
--- a/sysdeps/unix/sysv/linux/setsockopt.S
+++ b/sysdeps/unix/sysv/linux/setsockopt.S
@@ -2,3 +2,4 @@
 #define	NARGS	5
 #define NO_WEAK_ALIAS	1
 #include <socket.S>
+weak_alias (setsockopt, __setsockopt)
diff --git a/sysdeps/unix/sysv/linux/x86_64/syscalls.list b/sysdeps/unix/sysv/linux/x86_64/syscalls.list
index 4d9f75f7b7..dcb1a090d7 100644
--- a/sysdeps/unix/sysv/linux/x86_64/syscalls.list
+++ b/sysdeps/unix/sysv/linux/x86_64/syscalls.list
@@ -38,8 +38,8 @@ getsockname	-	getsockname	i:ipp	__getsockname	getsockname
 getsockopt	-	getsockopt	i:iiiBN	__getsockopt	getsockopt
 listen		-	listen		i:ii	__listen	listen
 recvfrom	-	recvfrom	i:ibniBN	__libc_recvfrom	__recvfrom recvfrom
-recvmsg		-	recvmsg		i:ipi	__libc_recvmsg	recvmsg
-sendmsg		-	sendmsg		i:ipi	__libc_sendmsg	sendmsg
+recvmsg		-	recvmsg		i:ipi	__libc_recvmsg	__recvmsg recvmsg
+sendmsg		-	sendmsg		i:ipi	__libc_sendmsg	__sendmsg sendmsg
 sendto		-	sendto		i:ibnibn	__libc_sendto	__sendto sendto
 setsockopt	-	setsockopt	i:iiibn	__setsockopt	setsockopt
 shutdown	-	shutdown	i:ii	__shutdown	shutdown