From 11b9aee8ff8c9ab70ef6e5b6d68f75cd8a44c4d5 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Thu, 8 Dec 2005 14:29:53 +0000 Subject: Again rpc ;-( , all *inet*, *addr* --- libc/inet/addr.c | 27 +++++++++++++++------------ libc/inet/ether_addr.c | 26 ++++++++++++++------------ libc/inet/getaddrinfo.c | 34 +++++++++++++++++++--------------- libc/inet/getnetent.c | 2 ++ libc/inet/getproto.c | 1 + libc/inet/getservice.c | 1 + libc/inet/herror.c | 3 ++- libc/inet/if_nametoindex.c | 8 ++++---- libc/inet/inet_net.c | 5 +++-- libc/inet/ntop.c | 18 ++++++------------ libc/inet/resolv.c | 5 +++++ libc/inet/rpc/auth_unix.c | 1 + libc/inet/rpc/bindresvport.c | 7 +++++-- libc/inet/rpc/clnt_tcp.c | 2 ++ libc/inet/rpc/clnt_udp.c | 8 +++++--- libc/inet/rpc/clnt_unix.c | 2 ++ libc/inet/rpc/create_xid.c | 1 + libc/inet/rpc/get_myaddress.c | 4 ++-- libc/inet/rpc/getrpcent.c | 6 ++++-- libc/inet/rpc/pmap_clnt.c | 4 ++-- libc/inet/rpc/pmap_rmt.c | 8 +++++--- libc/inet/rpc/rcmd.c | 16 +++++++++++++--- libc/inet/rpc/rexec.c | 6 +++++- libc/inet/rpc/rtime.c | 3 +++ libc/inet/rpc/ruserpass.c | 1 + libc/inet/rpc/svc.c | 11 +++++------ libc/inet/rpc/svc_simple.c | 1 + libc/inet/rpc/svc_tcp.c | 3 +++ libc/inet/rpc/svc_udp.c | 4 ++++ libc/inet/rpc/svc_unix.c | 3 +++ libc/inet/socketcalls.c | 25 +++++++++++++++++-------- 31 files changed, 156 insertions(+), 90 deletions(-) (limited to 'libc/inet') diff --git a/libc/inet/addr.c b/libc/inet/addr.c index f46d54a8f..da40dea0c 100644 --- a/libc/inet/addr.c +++ b/libc/inet/addr.c @@ -28,8 +28,6 @@ #include #include -int inet_aton(const char *cp, struct in_addr *addrptr); - #ifdef L_inet_aton /* * More undocumented inet_aton features. @@ -47,9 +45,7 @@ int inet_aton(const char *cp, struct in_addr *addrptr); * leading 0 -> octal * all else -> decimal */ -int inet_aton(cp, addrptr) -const char *cp; -struct in_addr *addrptr; +int attribute_hidden __inet_aton(const char *cp, struct in_addr *addrptr) { in_addr_t addr; int value; @@ -95,25 +91,29 @@ struct in_addr *addrptr; return 1; } +strong_alias(__inet_aton,inet_aton) #endif #ifdef L_inet_addr -in_addr_t inet_addr(const char *cp) +extern int __inet_aton (__const char *__cp, struct in_addr *__inp) __THROW attribute_hidden; + +in_addr_t attribute_hidden __inet_addr(const char *cp) { struct in_addr a; - if (!inet_aton(cp, &a)) + if (!__inet_aton(cp, &a)) return INADDR_NONE; else return a.s_addr; } +strong_alias(__inet_addr,inet_addr) #endif #ifdef L_inet_ntoa #define INET_NTOA_MAX_LEN 16 /* max 12 digits + 3 '.'s + 1 nul */ -char *inet_ntoa_r(struct in_addr in, char buf[INET_NTOA_MAX_LEN]) +char attribute_hidden *__inet_ntoa_r(struct in_addr in, char buf[INET_NTOA_MAX_LEN]) { in_addr_t addr = ntohl(in.s_addr); int i; @@ -132,12 +132,14 @@ char *inet_ntoa_r(struct in_addr in, char buf[INET_NTOA_MAX_LEN]) return p+1; } +strong_alias(__inet_ntoa_r,inet_ntoa_r) -char *inet_ntoa(struct in_addr in) +char attribute_hidden *__inet_ntoa(struct in_addr in) { static char buf[INET_NTOA_MAX_LEN]; - return(inet_ntoa_r(in, buf)); + return(__inet_ntoa_r(in, buf)); } +strong_alias(__inet_ntoa,inet_ntoa) #endif #ifdef L_inet_makeaddr @@ -189,8 +191,8 @@ in_addr_t inet_lnaof(struct in_addr in) * Return the network number from an internet * address; handles class a/b/c network #'s. */ -in_addr_t -inet_netof(struct in_addr in) +in_addr_t attribute_hidden +__inet_netof(struct in_addr in) { in_addr_t i = ntohl(in.s_addr); @@ -201,5 +203,6 @@ inet_netof(struct in_addr in) else return (((i)&IN_CLASSC_NET) >> IN_CLASSC_NSHIFT); } +strong_alias(__inet_netof,inet_netof) #endif diff --git a/libc/inet/ether_addr.c b/libc/inet/ether_addr.c index fb58e148d..83af50210 100644 --- a/libc/inet/ether_addr.c +++ b/libc/inet/ether_addr.c @@ -32,14 +32,7 @@ #include #include -struct ether_addr *ether_aton(const char *asc) -{ - static struct ether_addr result; - - return ether_aton_r(asc, &result); -} - -struct ether_addr *ether_aton_r(const char *asc, struct ether_addr *addr) +struct ether_addr attribute_hidden *__ether_aton_r(const char *asc, struct ether_addr *addr) { size_t cnt; @@ -75,15 +68,16 @@ struct ether_addr *ether_aton_r(const char *asc, struct ether_addr *addr) return addr; } +strong_alias(__ether_aton_r,ether_aton_r) -char *ether_ntoa(const struct ether_addr *addr) +struct ether_addr *ether_aton(const char *asc) { - static char asc[18]; + static struct ether_addr result; - return ether_ntoa_r(addr, asc); + return __ether_aton_r(asc, &result); } -char *ether_ntoa_r(const struct ether_addr *addr, char *buf) +char attribute_hidden *__ether_ntoa_r(const struct ether_addr *addr, char *buf) { sprintf(buf, "%x:%x:%x:%x:%x:%x", addr->ether_addr_octet[0], addr->ether_addr_octet[1], @@ -91,3 +85,11 @@ char *ether_ntoa_r(const struct ether_addr *addr, char *buf) addr->ether_addr_octet[4], addr->ether_addr_octet[5]); return buf; } +strong_alias(__ether_ntoa_r,ether_ntoa_r) + +char *ether_ntoa(const struct ether_addr *addr) +{ + static char asc[18]; + + return __ether_ntoa_r(addr, asc); +} diff --git a/libc/inet/getaddrinfo.c b/libc/inet/getaddrinfo.c index e896e3449..2dd14d78f 100644 --- a/libc/inet/getaddrinfo.c +++ b/libc/inet/getaddrinfo.c @@ -48,6 +48,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define gethostbyname_r __gethostbyname_r #define gethostbyname2_r __gethostbyname2_r #define gethostbyaddr_r __gethostbyaddr_r +#define inet_pton __inet_pton +#define inet_ntop __inet_ntop +#define strtoul __strtoul #if 0 #define uname __uname #define stpcpy __stpcpy @@ -771,6 +774,20 @@ static struct gaih gaih[] = { PF_UNSPEC, NULL } }; +void attribute_hidden +__freeaddrinfo (struct addrinfo *ai) +{ + struct addrinfo *p; + + while (ai != NULL) + { + p = ai; + ai = ai->ai_next; + free (p); + } +} +strong_alias(__freeaddrinfo,freeaddrinfo) + int attribute_hidden __getaddrinfo (const char *name, const char *service, const struct addrinfo *hints, struct addrinfo **pai) @@ -842,7 +859,7 @@ __getaddrinfo (const char *name, const char *service, continue; if (p) - freeaddrinfo (p); + __freeaddrinfo (p); return -(i & GAIH_EAI); } @@ -866,21 +883,8 @@ __getaddrinfo (const char *name, const char *service, return 0; if (p) - freeaddrinfo (p); + __freeaddrinfo (p); return last_i ? -(last_i & GAIH_EAI) : EAI_NONAME; } strong_alias(__getaddrinfo,getaddrinfo) - -void -freeaddrinfo (struct addrinfo *ai) -{ - struct addrinfo *p; - - while (ai != NULL) - { - p = ai; - ai = ai->ai_next; - free (p); - } -} diff --git a/libc/inet/getnetent.c b/libc/inet/getnetent.c index 476fa6b0e..f2c2cd97d 100644 --- a/libc/inet/getnetent.c +++ b/libc/inet/getnetent.c @@ -15,6 +15,8 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ +#define inet_network __inet_network + #define __FORCE_GLIBC #include #include diff --git a/libc/inet/getproto.c b/libc/inet/getproto.c index adb83a5ca..ec00b5e93 100644 --- a/libc/inet/getproto.c +++ b/libc/inet/getproto.c @@ -52,6 +52,7 @@ */ #define strpbrk __strpbrk +#define atoi __atoi #define __FORCE_GLIBC #define _GNU_SOURCE diff --git a/libc/inet/getservice.c b/libc/inet/getservice.c index 4040dc9b6..6026273b4 100644 --- a/libc/inet/getservice.c +++ b/libc/inet/getservice.c @@ -52,6 +52,7 @@ */ #define strpbrk __strpbrk +#define atoi __atoi #define __FORCE_GLIBC #define _GNU_SOURCE diff --git a/libc/inet/herror.c b/libc/inet/herror.c index 79b84084f..2f0797b91 100644 --- a/libc/inet/herror.c +++ b/libc/inet/herror.c @@ -36,7 +36,7 @@ static const int h_nerr = { sizeof(h_errlist)/sizeof(h_errlist[0]) }; /* * herror -- print the error indicated by the h_errno value. */ -void herror(const char *s) +void attribute_hidden __herror(const char *s) { static const char colon_space[] = ": "; const char *p; @@ -52,6 +52,7 @@ void herror(const char *s) } fprintf(stderr, "%s%s%s\n", s, c, p); } +strong_alias(__herror,herror) const char *hstrerror(int err) diff --git a/libc/inet/if_nametoindex.c b/libc/inet/if_nametoindex.c index 0e556dba8..909cf503a 100644 --- a/libc/inet/if_nametoindex.c +++ b/libc/inet/if_nametoindex.c @@ -52,7 +52,7 @@ unsigned int if_nametoindex(const char* ifname) if (fd < 0) return 0; __strncpy (ifr.ifr_name, ifname, sizeof (ifr.ifr_name)); - if (ioctl(fd,SIOCGIFINDEX,&ifr) < 0) { + if (__ioctl(fd,SIOCGIFINDEX,&ifr) < 0) { int saved_errno = errno; __close(fd); if (saved_errno == EINVAL) @@ -102,7 +102,7 @@ struct if_nameindex * if_nameindex (void) /* Read all the interfaces out of the kernel. */ do { ifc.ifc_buf = realloc(ifc.ifc_buf, ifc.ifc_len = rq_len); - if (ifc.ifc_buf == NULL || ioctl(fd, SIOCGIFCONF, &ifc) < 0) { + if (ifc.ifc_buf == NULL || __ioctl(fd, SIOCGIFCONF, &ifc) < 0) { __close(fd); return NULL; } @@ -121,7 +121,7 @@ struct if_nameindex * if_nameindex (void) for (i = 0; i < nifs; ++i) { struct ifreq *ifr = &ifc.ifc_req[i]; idx[i].if_name = __strdup (ifr->ifr_name); - if (idx[i].if_name == NULL || ioctl(fd,SIOCGIFINDEX,ifr) < 0) { + if (idx[i].if_name == NULL || __ioctl(fd,SIOCGIFINDEX,ifr) < 0) { int saved_errno = errno; unsigned int j; for (j = 0; j < i; ++j) @@ -159,7 +159,7 @@ char * if_indextoname (unsigned int ifindex, char *ifname) return NULL; ifr.ifr_ifindex = ifindex; - if (ioctl (fd, SIOCGIFNAME, &ifr) < 0) { + if (__ioctl (fd, SIOCGIFNAME, &ifr) < 0) { saved_errno = errno; __close (fd); __set_errno (saved_errno); diff --git a/libc/inet/inet_net.c b/libc/inet/inet_net.c index 74fa390ac..cc9537df5 100644 --- a/libc/inet/inet_net.c +++ b/libc/inet/inet_net.c @@ -42,8 +42,8 @@ * The library routines call this routine to interpret * network numbers. */ -in_addr_t -inet_network(const char *cp) +in_addr_t attribute_hidden +__inet_network(const char *cp) { register in_addr_t val, base, n; register char c; @@ -98,3 +98,4 @@ again: } return (val); } +strong_alias(__inet_network,inet_network) diff --git a/libc/inet/ntop.c b/libc/inet/ntop.c index 65ff1842b..2fcc77591 100644 --- a/libc/inet/ntop.c +++ b/libc/inet/ntop.c @@ -349,12 +349,8 @@ inet_pton6(const char *src, u_char *dst) * author: * Paul Vixie, 1996. */ -extern const char * -inet_ntop(af, src, dst, size) - int af; - const void *src; - char *dst; - socklen_t size; +const char attribute_hidden * +__inet_ntop(int af, const void *src, char *dst, socklen_t size) { switch (af) { case AF_INET: @@ -369,6 +365,7 @@ inet_ntop(af, src, dst, size) } /* NOTREACHED */ } +strong_alias(__inet_ntop,inet_ntop) /* int @@ -382,11 +379,8 @@ inet_ntop(af, src, dst, size) * author: * Paul Vixie, 1996. */ -extern int -inet_pton(af, src, dst) - int af; - const char *src; - void *dst; +int attribute_hidden +__inet_pton(int af, const char *src, void *dst) { switch (af) { case AF_INET: @@ -401,4 +395,4 @@ inet_pton(af, src, dst) } /* NOTREACHED */ } - +strong_alias(__inet_pton,inet_pton) diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c index af38c14a5..ce849d03b 100644 --- a/libc/inet/resolv.c +++ b/libc/inet/resolv.c @@ -140,6 +140,11 @@ #define getservbyport __getservbyport #define getdomainname __getdomainname #define uname __uname +#define inet_addr __inet_addr +#define inet_aton __inet_aton +#define inet_pton __inet_pton +#define inet_ntop __inet_ntop +#define connect __connect #define __FORCE_GLIBC #include diff --git a/libc/inet/rpc/auth_unix.c b/libc/inet/rpc/auth_unix.c index 87852f36e..85fb98a63 100644 --- a/libc/inet/rpc/auth_unix.c +++ b/libc/inet/rpc/auth_unix.c @@ -46,6 +46,7 @@ #define xdrmem_create __xdrmem_create #define xdr_authunix_parms __xdr_authunix_parms #define xdr_opaque_auth __xdr_opaque_auth +#define gettimeofday __gettimeofday #define __FORCE_GLIBC #include diff --git a/libc/inet/rpc/bindresvport.c b/libc/inet/rpc/bindresvport.c index 1fb80d701..530df52b3 100644 --- a/libc/inet/rpc/bindresvport.c +++ b/libc/inet/rpc/bindresvport.c @@ -30,6 +30,8 @@ * Copyright (c) 1987 by Sun Microsystems, Inc. */ +#define bind __bind + #define __FORCE_GLIBC #include @@ -43,8 +45,8 @@ /* * Bind a socket to a privileged IP port */ -int -bindresvport (int sd, struct sockaddr_in *sin) +int attribute_hidden +__bindresvport (int sd, struct sockaddr_in *sin) { int res; static short port; @@ -86,3 +88,4 @@ bindresvport (int sd, struct sockaddr_in *sin) return res; } +strong_alias(__bindresvport,bindresvport) diff --git a/libc/inet/rpc/clnt_tcp.c b/libc/inet/rpc/clnt_tcp.c index f006c3383..50300d591 100644 --- a/libc/inet/rpc/clnt_tcp.c +++ b/libc/inet/rpc/clnt_tcp.c @@ -60,6 +60,8 @@ static char sccsid[] = "@(#)clnt_tcp.c 1.37 87/10/05 Copyr 1984 Sun Micro"; #define xdrmem_create __xdrmem_create #define pmap_getport __pmap_getport #define _seterr_reply __seterr_reply +#define connect __connect +#define bindresvport __bindresvport #define __FORCE_GLIBC #include diff --git a/libc/inet/rpc/clnt_udp.c b/libc/inet/rpc/clnt_udp.c index c59a119b9..217650bf5 100644 --- a/libc/inet/rpc/clnt_udp.c +++ b/libc/inet/rpc/clnt_udp.c @@ -47,6 +47,8 @@ static char sccsid[] = "@(#)clnt_udp.c 1.39 87/08/11 Copyr 1984 Sun Micro"; #define xdr_opaque_auth __xdr_opaque_auth #define pmap_getport __pmap_getport #define _seterr_reply __seterr_reply +#define setsockopt __setsockopt +#define bindresvport __bindresvport #define __FORCE_GLIBC #include @@ -206,7 +208,7 @@ __clntudp_bufcreate (struct sockaddr_in *raddr, u_long program, u_long version, /* attempt to bind to prov port */ (void) bindresvport (*sockp, (struct sockaddr_in *) 0); /* the sockets rpc controls are non-blocking */ - (void) ioctl (*sockp, FIONBIO, (char *) &dontblock); + (void) __ioctl (*sockp, FIONBIO, (char *) &dontblock); #ifdef IP_RECVERR { int on = 1; @@ -250,13 +252,13 @@ is_network_up (int sock) ifc.ifc_len = sizeof (buf); ifc.ifc_buf = buf; - if (ioctl(sock, SIOCGIFCONF, (char *) &ifc) == 0) + if (__ioctl(sock, SIOCGIFCONF, (char *) &ifc) == 0) { ifr = ifc.ifc_req; for (n = ifc.ifc_len / sizeof (struct ifreq); n > 0; n--, ifr++) { ifreq = *ifr; - if (ioctl (sock, SIOCGIFFLAGS, (char *) &ifreq) < 0) + if (__ioctl (sock, SIOCGIFFLAGS, (char *) &ifreq) < 0) break; if ((ifreq.ifr_flags & IFF_UP) diff --git a/libc/inet/rpc/clnt_unix.c b/libc/inet/rpc/clnt_unix.c index efdd39005..23154bab3 100644 --- a/libc/inet/rpc/clnt_unix.c +++ b/libc/inet/rpc/clnt_unix.c @@ -57,6 +57,8 @@ #define getegid __getegid #define geteuid __geteuid #define _seterr_reply __seterr_reply +#define setsockopt __setsockopt +#define connect __connect #define __FORCE_GLIBC #include diff --git a/libc/inet/rpc/create_xid.c b/libc/inet/rpc/create_xid.c index 3dbf7af61..69b83ff59 100644 --- a/libc/inet/rpc/create_xid.c +++ b/libc/inet/rpc/create_xid.c @@ -19,6 +19,7 @@ #define lrand48_r __lrand48_r #define srand48_r __srand48_r +#define gettimeofday __gettimeofday #define __FORCE_GLIBC #include diff --git a/libc/inet/rpc/get_myaddress.c b/libc/inet/rpc/get_myaddress.c index 684e4d7ec..51674656e 100644 --- a/libc/inet/rpc/get_myaddress.c +++ b/libc/inet/rpc/get_myaddress.c @@ -72,7 +72,7 @@ get_myaddress (struct sockaddr_in *addr) } ifc.ifc_len = sizeof (buf); ifc.ifc_buf = buf; - if (ioctl (s, SIOCGIFCONF, (char *) &ifc) < 0) + if (__ioctl (s, SIOCGIFCONF, (char *) &ifc) < 0) { __perror (_("get_myaddress: ioctl (get interface configuration)")); exit (1); @@ -83,7 +83,7 @@ get_myaddress (struct sockaddr_in *addr) for (len = ifc.ifc_len; len; len -= sizeof ifreq) { ifreq = *ifr; - if (ioctl (s, SIOCGIFFLAGS, (char *) &ifreq) < 0) + if (__ioctl (s, SIOCGIFFLAGS, (char *) &ifreq) < 0) { __perror ("get_myaddress: ioctl"); exit (1); diff --git a/libc/inet/rpc/getrpcent.c b/libc/inet/rpc/getrpcent.c index bc6ab7057..90e8b70d4 100644 --- a/libc/inet/rpc/getrpcent.c +++ b/libc/inet/rpc/getrpcent.c @@ -1,6 +1,4 @@ /* @(#)getrpcent.c 2.2 88/07/29 4.0 RPCSRC */ -#define __FORCE_GLIBC -#include /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for @@ -35,6 +33,10 @@ * Copyright (c) 1985 by Sun Microsystems, Inc. */ +#define atoi __atoi + +#define __FORCE_GLIBC +#include #include #include #include diff --git a/libc/inet/rpc/pmap_clnt.c b/libc/inet/rpc/pmap_clnt.c index dbd3e3198..0abe646a1 100644 --- a/libc/inet/rpc/pmap_clnt.c +++ b/libc/inet/rpc/pmap_clnt.c @@ -73,7 +73,7 @@ __get_myaddress (struct sockaddr_in *addr) } ifc.ifc_len = sizeof (buf); ifc.ifc_buf = buf; - if (ioctl (s, SIOCGIFCONF, (char *) &ifc) < 0) + if (__ioctl (s, SIOCGIFCONF, (char *) &ifc) < 0) { __perror (_("__get_myaddress: ioctl (get interface configuration)")); exit (1); @@ -84,7 +84,7 @@ __get_myaddress (struct sockaddr_in *addr) for (len = ifc.ifc_len; len; len -= sizeof ifreq) { ifreq = *ifr; - if (ioctl (s, SIOCGIFFLAGS, (char *) &ifreq) < 0) + if (__ioctl (s, SIOCGIFFLAGS, (char *) &ifreq) < 0) { __perror ("__get_myaddress: ioctl"); exit (1); diff --git a/libc/inet/rpc/pmap_rmt.c b/libc/inet/rpc/pmap_rmt.c index 8a42d78ee..2a814795a 100644 --- a/libc/inet/rpc/pmap_rmt.c +++ b/libc/inet/rpc/pmap_rmt.c @@ -46,7 +46,9 @@ static char sccsid[] = "@(#)pmap_rmt.c 1.21 87/08/27 Copyr 1984 Sun Micro"; #define xdr_reference __xdr_reference #define xdr_u_long __xdr_u_long #define inet_makeaddr __inet_makeaddr +#define inet_netof __inet_netof #define clntudp_create __clntudp_create +#define setsockopt __setsockopt #define __FORCE_GLIBC #include @@ -193,7 +195,7 @@ getbroadcastnets (struct in_addr *addrs, int sock, char *buf) ifc.ifc_len = UDPMSGSIZE; ifc.ifc_buf = buf; - if (ioctl (sock, SIOCGIFCONF, (char *) &ifc) < 0) + if (__ioctl (sock, SIOCGIFCONF, (char *) &ifc) < 0) { __perror (_("broadcast: ioctl (get interface configuration)")); return (0); @@ -202,7 +204,7 @@ getbroadcastnets (struct in_addr *addrs, int sock, char *buf) for (i = 0, n = ifc.ifc_len / sizeof (struct ifreq); n > 0; n--, ifr++) { ifreq = *ifr; - if (ioctl (sock, SIOCGIFFLAGS, (char *) &ifreq) < 0) + if (__ioctl (sock, SIOCGIFFLAGS, (char *) &ifreq) < 0) { __perror (_("broadcast: ioctl (get interface flags)")); continue; @@ -213,7 +215,7 @@ getbroadcastnets (struct in_addr *addrs, int sock, char *buf) { sin = (struct sockaddr_in *) &ifr->ifr_addr; #ifdef SIOCGIFBRDADDR /* 4.3BSD */ - if (ioctl (sock, SIOCGIFBRDADDR, (char *) &ifreq) < 0) + if (__ioctl (sock, SIOCGIFBRDADDR, (char *) &ifreq) < 0) { addrs[i++] = inet_makeaddr (inet_netof /* Changed to pass struct instead of s_addr member diff --git a/libc/inet/rpc/rcmd.c b/libc/inet/rpc/rcmd.c index bbcc7b354..55f9e4042 100644 --- a/libc/inet/rpc/rcmd.c +++ b/libc/inet/rpc/rcmd.c @@ -43,6 +43,13 @@ static char sccsid[] = "@(#)rcmd.c 8.3 (Berkeley) 3/26/94"; #define getpwnam_r __getpwnam_r #define gethostbyname __gethostbyname #define gethostbyname_r __gethostbyname_r +#define fileno __fileno +#define sleep __sleep +#define inet_addr __inet_addr +#define inet_ntoa __inet_ntoa +#define herror __herror +#define bind __bind +#define connect __connect #define __FORCE_GLIBC #include @@ -67,6 +74,8 @@ static char sccsid[] = "@(#)rcmd.c 8.3 (Berkeley) 3/26/94"; #include +extern int __rresvport(int *alport) attribute_hidden; + /* some forward declarations */ static int __ivaliduser2(FILE *hostf, u_int32_t raddr, const char *luser, const char *ruser, const char *rhost); @@ -144,7 +153,7 @@ int rcmd(ahost, rport, locuser, remuser, cmd, fd2p) *ahost = hp->h_name; oldmask = sigblock(sigmask(SIGURG)); /* __sigblock */ for (timo = 1, lport = IPPORT_RESERVED - 1;;) { - s = rresvport(&lport); + s = __rresvport(&lport); if (s < 0) { if (errno == EAGAIN) (void)fprintf(stderr, @@ -195,7 +204,7 @@ int rcmd(ahost, rport, locuser, remuser, cmd, fd2p) lport = 0; } else { char num[8]; - int s2 = rresvport(&lport), s3; + int s2 = __rresvport(&lport), s3; socklen_t len = sizeof(from); if (s2 < 0) @@ -264,7 +273,7 @@ bad: return -1; } -int rresvport(int *alport) +int attribute_hidden __rresvport(int *alport) { struct sockaddr_in sin; int s; @@ -292,6 +301,7 @@ int rresvport(int *alport) return -1; } +strong_alias(__rresvport,rresvport) int __check_rhosts_file = 1; char *__rcmd_errstr; diff --git a/libc/inet/rpc/rexec.c b/libc/inet/rpc/rexec.c index 98a8bf32e..6312366eb 100644 --- a/libc/inet/rpc/rexec.c +++ b/libc/inet/rpc/rexec.c @@ -27,9 +27,13 @@ * SUCH DAMAGE. */ +#define getsockname __getsockname #define getnameinfo __getnameinfo #define getaddrinfo __getaddrinfo -#define getsockname __getsockname +#define freeaddrinfo __freeaddrinfo +#define sleep __sleep +#define atoi __atoi +#define connect __connect #define __FORCE_GLIBC #include diff --git a/libc/inet/rpc/rtime.c b/libc/inet/rpc/rtime.c index 554ad69eb..2e20621f9 100644 --- a/libc/inet/rpc/rtime.c +++ b/libc/inet/rpc/rtime.c @@ -42,6 +42,9 @@ static char sccsid[] = "@(#)rtime.c 2.2 88/08/10 4.0 RPCSRC; from 1.8 88/02/08 S * subtract seconds before Jan 1, 1970 to get * what unix uses. */ + +#define connect __connect + #define __FORCE_GLIBC #include diff --git a/libc/inet/rpc/ruserpass.c b/libc/inet/rpc/ruserpass.c index 3c48122ac..a3408dee0 100644 --- a/libc/inet/rpc/ruserpass.c +++ b/libc/inet/rpc/ruserpass.c @@ -33,6 +33,7 @@ #define getegid __getegid #define geteuid __geteuid #define gethostname __gethostname +#define fileno __fileno #define __FORCE_GLIBC #include diff --git a/libc/inet/rpc/svc.c b/libc/inet/rpc/svc.c index 727abcbd8..168c6e406 100644 --- a/libc/inet/rpc/svc.c +++ b/libc/inet/rpc/svc.c @@ -36,16 +36,14 @@ * Copyright (C) 1984, Sun Microsystems, Inc. */ +#define ffs __ffs #define pmap_set __pmap_set #define pmap_unset __pmap_unset - #define _authenticate _authenticate_internal #define _rpc_dtablesize _rpc_dtablesize_internal - /* used by svc_[max_]pollfd */ #define __rpc_thread_svc_pollfd __rpc_thread_svc_pollfd_internal #define __rpc_thread_svc_max_pollfd __rpc_thread_svc_max_pollfd_internal - /* used by svc_fdset */ #define __rpc_thread_svc_fdset __rpc_thread_svc_fdset_internal @@ -131,8 +129,8 @@ __xprt_register (SVCXPRT *xprt) strong_alias(__xprt_register,xprt_register) /* De-activate a transport handle. */ -void -xprt_unregister (SVCXPRT *xprt) +void attribute_hidden +__xprt_unregister (SVCXPRT *xprt) { register int sock = xprt->xp_sock; register int i; @@ -149,6 +147,7 @@ xprt_unregister (SVCXPRT *xprt) svc_pollfd[i].fd = -1; } } +strong_alias(__xprt_unregister,xprt_unregister) /* ********************** CALLOUT list related stuff ************* */ @@ -494,7 +493,7 @@ __svc_getreq_poll (struct pollfd *pfdp, int pollretval) ++fds_found; if (p->revents & POLLNVAL) - xprt_unregister (xports[p->fd]); + __xprt_unregister (xports[p->fd]); else __svc_getreq_common (p->fd); } diff --git a/libc/inet/rpc/svc_simple.c b/libc/inet/rpc/svc_simple.c index e0509be70..6b8fe7103 100644 --- a/libc/inet/rpc/svc_simple.c +++ b/libc/inet/rpc/svc_simple.c @@ -43,6 +43,7 @@ static char sccsid[] = "@(#)svc_simple.c 1.18 87/08/11 Copyr 1984 Sun Micro"; #define svcerr_decode __svcerr_decode #define svcudp_create __svcudp_create #define pmap_unset __pmap_unset +#define asprintf __asprintf #define __FORCE_GLIBC #define _GNU_SOURCE diff --git a/libc/inet/rpc/svc_tcp.c b/libc/inet/rpc/svc_tcp.c index 32b3cc995..b3cd83fa8 100644 --- a/libc/inet/rpc/svc_tcp.c +++ b/libc/inet/rpc/svc_tcp.c @@ -48,7 +48,10 @@ static char sccsid[] = "@(#)svc_tcp.c 1.21 87/08/11 Copyr 1984 Sun Micro"; #define xdr_callmsg __xdr_callmsg #define xdr_replymsg __xdr_replymsg #define xprt_register __xprt_register +#define xprt_unregister __xprt_unregister #define getsockname __getsockname +#define bind __bind +#define bindresvport __bindresvport #define __FORCE_GLIBC #define _GNU_SOURCE diff --git a/libc/inet/rpc/svc_udp.c b/libc/inet/rpc/svc_udp.c index 197084144..0f731a6ba 100644 --- a/libc/inet/rpc/svc_udp.c +++ b/libc/inet/rpc/svc_udp.c @@ -40,10 +40,14 @@ static char sccsid[] = "@(#)svc_udp.c 1.24 87/08/11 Copyr 1984 Sun Micro"; */ #define xprt_register __xprt_register +#define xprt_unregister __xprt_unregister #define xdrmem_create __xdrmem_create #define xdr_callmsg __xdr_callmsg #define xdr_replymsg __xdr_replymsg #define getsockname __getsockname +#define setsockopt __setsockopt +#define bind __bind +#define bindresvport __bindresvport #define __FORCE_GLIBC #define _GNU_SOURCE diff --git a/libc/inet/rpc/svc_unix.c b/libc/inet/rpc/svc_unix.c index 79c27ac5f..8b1e8b2d5 100644 --- a/libc/inet/rpc/svc_unix.c +++ b/libc/inet/rpc/svc_unix.c @@ -44,9 +44,12 @@ #define xdr_callmsg __xdr_callmsg #define xdr_replymsg __xdr_replymsg #define xprt_register __xprt_register +#define xprt_unregister __xprt_unregister #define getegid __getegid #define geteuid __geteuid #define getsockname __getsockname +#define setsockopt __setsockopt +#define bind __bind #define __FORCE_GLIBC #include diff --git a/libc/inet/socketcalls.c b/libc/inet/socketcalls.c index 1dbffa3d1..02b887b93 100644 --- a/libc/inet/socketcalls.c +++ b/libc/inet/socketcalls.c @@ -48,9 +48,11 @@ weak_alias(__libc_accept, accept); #ifdef L_bind #ifdef __NR_bind -_syscall3(int, bind, int, sockfd, const struct sockaddr *, myaddr, socklen_t, addrlen); +#define __NR___bind __NR_bind +attribute_hidden _syscall3(int, __bind, int, sockfd, const struct sockaddr *, myaddr, socklen_t, addrlen); +strong_alias(__bind,bind) #elif defined(__NR_socketcall) -int bind(int sockfd, const struct sockaddr *myaddr, socklen_t addrlen) +int attribute_hidden __bind(int sockfd, const struct sockaddr *myaddr, socklen_t addrlen) { unsigned long args[3]; @@ -59,15 +61,18 @@ int bind(int sockfd, const struct sockaddr *myaddr, socklen_t addrlen) args[2] = addrlen; return __socketcall(SYS_BIND, args); } +strong_alias(__bind,bind) #endif #endif #ifdef L_connect #ifdef __NR_connect -#define __NR___libc_connect __NR_connect -_syscall3(int, __libc_connect, int, sockfd, const struct sockaddr *, saddr, socklen_t, addrlen); +#define __NR___connect __NR_connect +attribute_hidden _syscall3(int, __connect, int, sockfd, const struct sockaddr *, saddr, socklen_t, addrlen); +strong_alias(__connect,connect) +weak_alias(__connect,__libc_connect) #elif defined(__NR_socketcall) -int __libc_connect(int sockfd, const struct sockaddr *saddr, socklen_t addrlen) +int attribute_hidden __connect(int sockfd, const struct sockaddr *saddr, socklen_t addrlen) { unsigned long args[3]; @@ -76,8 +81,9 @@ int __libc_connect(int sockfd, const struct sockaddr *saddr, socklen_t addrlen) args[2] = addrlen; return __socketcall(SYS_CONNECT, args); } +strong_alias(__connect,connect) +weak_alias(__connect,__libc_connect) #endif -weak_alias(__libc_connect, connect); #endif #ifdef L_getpeername @@ -289,10 +295,12 @@ weak_alias(__libc_sendto, sendto); #ifdef L_setsockopt #ifdef __NR_setsockopt -_syscall5(int, setsockopt, int, fd, int, level, int, optname, const void *, optval, socklen_t, optlen); +#define __NR___setsockopt __NR_setsockopt +attribute_hidden _syscall5(int, __setsockopt, int, fd, int, level, int, optname, const void *, optval, socklen_t, optlen); +strong_alias(__setsockopt,setsockopt) #elif defined(__NR_socketcall) /* [sg]etsockoptions by bir7@leland.stanford.edu */ -int setsockopt(int fd, int level, int optname, const void *optval, +int attribute_hidden __setsockopt(int fd, int level, int optname, const void *optval, socklen_t optlen) { unsigned long args[5]; @@ -304,6 +312,7 @@ int setsockopt(int fd, int level, int optname, const void *optval, args[4] = optlen; return (__socketcall(SYS_SETSOCKOPT, args)); } +strong_alias(__setsockopt,setsockopt) #endif #endif -- cgit v1.2.3