diff options
Diffstat (limited to 'libc/inet')
35 files changed, 259 insertions, 148 deletions
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 <netinet/in.h> #include <bits/uClibc_uintmaxtostr.h> -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..0a1e2aede 100644 --- a/libc/inet/ether_addr.c +++ b/libc/inet/ether_addr.c @@ -32,14 +32,7 @@ #include <netinet/ether.h> #include <netinet/if_ether.h> -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,19 +68,28 @@ 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", + __sprintf(buf, "%x:%x:%x:%x:%x:%x", addr->ether_addr_octet[0], addr->ether_addr_octet[1], addr->ether_addr_octet[2], addr->ether_addr_octet[3], 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..a85e2ff5e 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 @@ -156,7 +159,7 @@ static int addrconfig (sa_family_t af) int s; int ret; int saved_errno = errno; - s = socket(af, SOCK_DGRAM, 0); + s = __socket(af, SOCK_DGRAM, 0); if (s < 0) ret = (errno == EMFILE) ? 1 : 0; else @@ -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..edbae55b0 100644 --- a/libc/inet/getnetent.c +++ b/libc/inet/getnetent.c @@ -15,6 +15,9 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ +#define inet_network __inet_network +#define rewind __rewind + #define __FORCE_GLIBC #include <features.h> #include <stdio.h> diff --git a/libc/inet/getproto.c b/libc/inet/getproto.c index adb83a5ca..0c0e2c468 100644 --- a/libc/inet/getproto.c +++ b/libc/inet/getproto.c @@ -52,6 +52,8 @@ */ #define strpbrk __strpbrk +#define atoi __atoi +#define rewind __rewind #define __FORCE_GLIBC #define _GNU_SOURCE diff --git a/libc/inet/getservice.c b/libc/inet/getservice.c index 4040dc9b6..79cdf7434 100644 --- a/libc/inet/getservice.c +++ b/libc/inet/getservice.c @@ -52,6 +52,8 @@ */ #define strpbrk __strpbrk +#define atoi __atoi +#define rewind __rewind #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..f3803e56b 100644 --- a/libc/inet/if_nametoindex.c +++ b/libc/inet/if_nametoindex.c @@ -32,10 +32,10 @@ static int __opensock(void) { int fd; #ifdef __UCLIBC_HAS_IPV6__ - fd=socket(AF_INET6,SOCK_DGRAM,0); + fd=__socket(AF_INET6,SOCK_DGRAM,0); if (fd<0) #endif /* __UCLIBC_HAS_IPV6__ */ - fd=socket(AF_INET,SOCK_DGRAM,0); + fd=__socket(AF_INET,SOCK_DGRAM,0); return(fd); } @@ -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..a7d1844a7 100644 --- a/libc/inet/inet_net.c +++ b/libc/inet/inet_net.c @@ -42,13 +42,13 @@ * 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; in_addr_t parts[4], *pp = parts; - register int i; + register unsigned int i; again: /* @@ -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..91fa2b899 100644 --- a/libc/inet/ntop.c +++ b/libc/inet/ntop.c @@ -163,7 +163,7 @@ inet_ntop6(const u_char *src, char *dst, size_t size) tp += __strlen(tp); break; } - tp += sprintf(tp, "%x", words[i]); + tp += __sprintf(tp, "%x", words[i]); } /* Was it a trailing run of 0x00's? */ if (best.base != -1 && (best.base + best.len) == 8) @@ -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/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 <features.h> 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 <features.h> @@ -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_perror.c b/libc/inet/rpc/clnt_perror.c index 9173f17af..611ca998c 100644 --- a/libc/inet/rpc/clnt_perror.c +++ b/libc/inet/rpc/clnt_perror.c @@ -220,7 +220,7 @@ __clnt_sperror (CLIENT * rpch, const char *msg) return NULL; CLNT_GETERR (rpch, &e); - len = sprintf (str, "%s: ", msg); + len = __sprintf (str, "%s: ", msg); str += len; (void) __strcpy(str, __clnt_sperrno(e.re_status)); @@ -246,12 +246,12 @@ __clnt_sperror (CLIENT * rpch, const char *msg) case RPC_CANTSEND: case RPC_CANTRECV: strerror_r (e.re_errno, chrbuf, sizeof chrbuf); - len = sprintf (str, "; errno = %s", chrbuf); + len = __sprintf (str, "; errno = %s", chrbuf); str += len; break; case RPC_VERSMISMATCH: - len= sprintf (str, _("; low version = %lu, high version = %lu"), + len= __sprintf (str, _("; low version = %lu, high version = %lu"), e.re_vers.low, e.re_vers.high); str += len; break; @@ -268,20 +268,20 @@ __clnt_sperror (CLIENT * rpch, const char *msg) } else { - len = sprintf (str, _("(unknown authentication error - %d)"), + len = __sprintf (str, _("(unknown authentication error - %d)"), (int) e.re_why); str += len; } break; case RPC_PROGVERSMISMATCH: - len = sprintf (str, _("; low version = %lu, high version = %lu"), + len = __sprintf (str, _("; low version = %lu, high version = %lu"), e.re_vers.low, e.re_vers.high); str += len; break; default: /* unknown */ - len = sprintf (str, "; s1 = %lu, s2 = %lu", e.re_lb.s1, e.re_lb.s2); + len = __sprintf (str, "; s1 = %lu, s2 = %lu", e.re_lb.s1, e.re_lb.s2); str += len; break; } @@ -315,7 +315,7 @@ __clnt_spcreateerror (const char *msg) if (str == NULL) return NULL; ce = &get_rpc_createerr (); - len = sprintf (str, "%s: ", msg); + len = __sprintf (str, "%s: ", msg); cp = str + len; (void) __strcpy(cp, __clnt_sperrno (ce->cf_stat)); cp += __strlen(cp); diff --git a/libc/inet/rpc/clnt_tcp.c b/libc/inet/rpc/clnt_tcp.c index f006c3383..c415a447d 100644 --- a/libc/inet/rpc/clnt_tcp.c +++ b/libc/inet/rpc/clnt_tcp.c @@ -60,6 +60,9 @@ 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 poll __poll #define __FORCE_GLIBC #include <features.h> @@ -173,7 +176,7 @@ __clnttcp_create (struct sockaddr_in *raddr, u_long prog, u_long vers, */ if (*sockp < 0) { - *sockp = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP); + *sockp = __socket (AF_INET, SOCK_STREAM, IPPROTO_TCP); (void) bindresvport (*sockp, (struct sockaddr_in *) 0); if ((*sockp < 0) || (connect (*sockp, (struct sockaddr *) raddr, diff --git a/libc/inet/rpc/clnt_udp.c b/libc/inet/rpc/clnt_udp.c index c59a119b9..2a9f7b135 100644 --- a/libc/inet/rpc/clnt_udp.c +++ b/libc/inet/rpc/clnt_udp.c @@ -47,6 +47,12 @@ 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 recvfrom __recvfrom +#define sendto __sendto +#define recvmsg __recvmsg +#define poll __poll #define __FORCE_GLIBC #include <features.h> @@ -195,7 +201,7 @@ __clntudp_bufcreate (struct sockaddr_in *raddr, u_long program, u_long version, { int dontblock = 1; - *sockp = socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP); + *sockp = __socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP); if (*sockp < 0) { struct rpc_createerr *ce = &get_rpc_createerr (); @@ -206,7 +212,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 +256,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..c97edba42 100644 --- a/libc/inet/rpc/clnt_unix.c +++ b/libc/inet/rpc/clnt_unix.c @@ -57,6 +57,11 @@ #define getegid __getegid #define geteuid __geteuid #define _seterr_reply __seterr_reply +#define setsockopt __setsockopt +#define connect __connect +#define recvmsg __recvmsg +#define sendmsg __sendmsg +#define poll __poll #define __FORCE_GLIBC #include <features.h> @@ -156,7 +161,7 @@ __clntunix_create (struct sockaddr_un *raddr, u_long prog, u_long vers, */ if (*sockp < 0) { - *sockp = socket (AF_UNIX, SOCK_STREAM, 0); + *sockp = __socket (AF_UNIX, SOCK_STREAM, 0); len = __strlen (raddr->sun_path) + sizeof (raddr->sun_family) + 1; if (*sockp < 0 || connect (*sockp, (struct sockaddr *) raddr, len) < 0) 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 <features.h> diff --git a/libc/inet/rpc/get_myaddress.c b/libc/inet/rpc/get_myaddress.c index 684e4d7ec..bdbafa44d 100644 --- a/libc/inet/rpc/get_myaddress.c +++ b/libc/inet/rpc/get_myaddress.c @@ -65,14 +65,14 @@ get_myaddress (struct sockaddr_in *addr) struct ifreq ifreq, *ifr; int len, loopback = 0; - if ((s = socket (AF_INET, SOCK_DGRAM, 0)) < 0) + if ((s = __socket (AF_INET, SOCK_DGRAM, 0)) < 0) { __perror ("get_myaddress: socket"); exit (1); } 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..c2e101510 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 <features.h> /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for @@ -35,6 +33,11 @@ * Copyright (c) 1985 by Sun Microsystems, Inc. */ +#define atoi __atoi +#define rewind __rewind + +#define __FORCE_GLIBC +#include <features.h> #include <stdio.h> #include <string.h> #include <sys/types.h> diff --git a/libc/inet/rpc/pmap_clnt.c b/libc/inet/rpc/pmap_clnt.c index dbd3e3198..49cd93f4b 100644 --- a/libc/inet/rpc/pmap_clnt.c +++ b/libc/inet/rpc/pmap_clnt.c @@ -66,14 +66,14 @@ __get_myaddress (struct sockaddr_in *addr) struct ifreq ifreq, *ifr; int len, loopback = 1; - if ((s = socket (AF_INET, SOCK_DGRAM, 0)) < 0) + if ((s = __socket (AF_INET, SOCK_DGRAM, 0)) < 0) { __perror ("__get_myaddress: socket"); exit (1); } 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..dbba18378 100644 --- a/libc/inet/rpc/pmap_rmt.c +++ b/libc/inet/rpc/pmap_rmt.c @@ -46,7 +46,12 @@ 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 recvfrom __recvfrom +#define sendto __sendto +#define poll __poll #define __FORCE_GLIBC #include <features.h> @@ -193,7 +198,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 +207,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 +218,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 @@ -272,7 +277,7 @@ clnt_broadcast (prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult) * initialization: create a socket, a broadcast address, and * preserialize the arguments into a send buffer. */ - if ((sock = socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) + if ((sock = __socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) { __perror (_("Cannot create socket for broadcast rpc")); stat = RPC_CANTSEND; diff --git a/libc/inet/rpc/rcmd.c b/libc/inet/rpc/rcmd.c index bbcc7b354..c2eed87d4 100644 --- a/libc/inet/rpc/rcmd.c +++ b/libc/inet/rpc/rcmd.c @@ -43,6 +43,19 @@ 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 sigblock __sigblock +#define snprintf __snprintf +#define poll __poll +#define accept __accept +#define listen __listen +#define sigsetmask __sigsetmask #define __FORCE_GLIBC #include <features.h> @@ -67,6 +80,8 @@ static char sccsid[] = "@(#)rcmd.c 8.3 (Berkeley) 3/26/94"; #include <arpa/inet.h> +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 +159,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 +210,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,14 +279,14 @@ bad: return -1; } -int rresvport(int *alport) +int attribute_hidden __rresvport(int *alport) { struct sockaddr_in sin; int s; sin.sin_family = AF_INET; sin.sin_addr.s_addr = INADDR_ANY; - s = socket(AF_INET, SOCK_STREAM, 0); + s = __socket(AF_INET, SOCK_STREAM, 0); if (s < 0) return -1; for (;;) { @@ -292,6 +307,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..239e87fb0 100644 --- a/libc/inet/rpc/rexec.c +++ b/libc/inet/rpc/rexec.c @@ -27,9 +27,16 @@ * 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 snprintf __snprintf +#define accept __accept +#define listen __listen #define __FORCE_GLIBC #include <features.h> @@ -89,7 +96,7 @@ __rexec_af(char **ahost, int rport, const char *name, const char *pass, const ch } __ruserpass(res0->ai_canonname, &name, &pass); retry: - s = socket(res0->ai_family, res0->ai_socktype, 0); + s = __socket(res0->ai_family, res0->ai_socktype, 0); if (s < 0) { __perror("rexec: socket"); return (-1); @@ -111,7 +118,7 @@ retry: char num[32]; int s2, sa2len; - s2 = socket(res0->ai_family, res0->ai_socktype, 0); + s2 = __socket(res0->ai_family, res0->ai_socktype, 0); if (s2 < 0) { (void) __close(s); return (-1); @@ -132,7 +139,7 @@ retry: NULL, 0, servbuff, sizeof(servbuff), NI_NUMERICSERV)) port = atoi(servbuff); - (void) sprintf(num, "%u", port); + (void) __sprintf(num, "%u", port); (void) __write(s, num, __strlen(num)+1); { socklen_t len = sizeof (from); s3 = accept(s2, (struct sockaddr *)&from, &len); diff --git a/libc/inet/rpc/rtime.c b/libc/inet/rpc/rtime.c index 554ad69eb..b4bbca19c 100644 --- a/libc/inet/rpc/rtime.c +++ b/libc/inet/rpc/rtime.c @@ -42,6 +42,12 @@ 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 recvfrom __recvfrom +#define sendto __sendto +#define poll __poll + #define __FORCE_GLIBC #include <features.h> @@ -90,7 +96,7 @@ rtime (struct sockaddr_in *addrp, struct rpc_timeval *timep, else type = SOCK_DGRAM; - s = socket (AF_INET, type, 0); + s = __socket (AF_INET, type, 0); if (s < 0) return (-1); diff --git a/libc/inet/rpc/ruserpass.c b/libc/inet/rpc/ruserpass.c index 3c48122ac..b7bc36864 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 <features.h> @@ -121,7 +122,7 @@ int attribute_hidden __ruserpass(const char *host, const char **aname, const cha cfile = fopen(buf, "r"); if (cfile == NULL) { if (errno != ENOENT) - printf("%s", buf); + __printf("%s", buf); return (0); } /* No threads use this stream. */ @@ -169,7 +170,7 @@ next: newp = malloc((unsigned) __strlen(tokval) + 1); if (newp == NULL) { - printf(_("out of memory")); + __printf(_("out of memory")); goto bad; } *aname = __strcpy(newp, tokval); @@ -183,8 +184,8 @@ next: if (__strcmp(*aname, "anonymous") && fstat(fileno(cfile), &stb) >= 0 && (stb.st_mode & 077) != 0) { - printf(_("Error: .netrc file is readable by others.")); - printf(_("Remove password or make file unreadable by others.")); + __printf(_("Error: .netrc file is readable by others.")); + __printf(_("Remove password or make file unreadable by others.")); goto bad; } if (token() && *apass == 0) { @@ -192,7 +193,7 @@ next: newp = malloc((unsigned) __strlen(tokval) + 1); if (newp == NULL) { - printf(_("out of memory")); + __printf(_("out of memory")); goto bad; } *apass = __strcpy(newp, tokval); @@ -202,8 +203,8 @@ next: #if 0 if (fstat(fileno(cfile), &stb) >= 0 && (stb.st_mode & 077) != 0) { - printf("Error: .netrc file is readable by others."); - printf("Remove account or make file unreadable by others."); + __printf("Error: .netrc file is readable by others."); + __printf("Remove account or make file unreadable by others."); goto bad; } if (token() && *aacct == 0) { @@ -221,11 +222,11 @@ next: while ((c=getc_unlocked(cfile)) != EOF && c == ' ' || c == '\t'); if (c == EOF || c == '\n') { - printf("Missing macdef name argument.\n"); + __printf("Missing macdef name argument.\n"); goto bad; } if (macnum == 16) { - printf("Limit of 16 macros have already been defined\n"); + __printf("Limit of 16 macros have already been defined\n"); goto bad; } tmp = macros[macnum].mac_name; @@ -235,7 +236,7 @@ next: *tmp++ = c; } if (c == EOF) { - printf("Macro definition missing null line terminator.\n"); + __printf("Macro definition missing null line terminator.\n"); goto bad; } *tmp = '\0'; @@ -244,7 +245,7 @@ next: && c != '\n'); } if (c == EOF) { - printf("Macro definition missing null line terminator.\n"); + __printf("Macro definition missing null line terminator.\n"); goto bad; } if (macnum == 0) { @@ -256,7 +257,7 @@ next: tmp = macros[macnum].mac_start; while (tmp != macbuf + 4096) { if ((c=getc_unlocked(cfile)) == EOF) { - printf("Macro definition missing null line terminator.\n"); + __printf("Macro definition missing null line terminator.\n"); goto bad; } *tmp = c; @@ -270,13 +271,13 @@ next: tmp++; } if (tmp == macbuf + 4096) { - printf("4K macro buffer exceeded\n"); + __printf("4K macro buffer exceeded\n"); goto bad; } #endif break; default: - printf(_("Unknown .netrc keyword %s"), tokval); + __printf(_("Unknown .netrc keyword %s"), tokval); break; } goto done; 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_auth_unix.c b/libc/inet/rpc/svc_auth_unix.c index 6c0f44f7d..0562a42fe 100644 --- a/libc/inet/rpc/svc_auth_unix.c +++ b/libc/inet/rpc/svc_auth_unix.c @@ -110,7 +110,7 @@ _svcauth_unix (struct svc_req *rqst, struct rpc_msg *msg) */ if ((5 + gid_len) * BYTES_PER_XDR_UNIT + str_len > auth_len) { - (void) printf ("bad auth_len gid %d str %d auth %d\n", + (void) __printf ("bad auth_len gid %d str %d auth %d\n", gid_len, str_len, auth_len); stat = AUTH_BADCRED; goto done; diff --git a/libc/inet/rpc/svc_run.c b/libc/inet/rpc/svc_run.c index b46320871..d2c06b895 100644 --- a/libc/inet/rpc/svc_run.c +++ b/libc/inet/rpc/svc_run.c @@ -32,6 +32,7 @@ */ #define svc_getreq_poll __svc_getreq_poll +#define poll __poll /* used by svc_[max_]pollfd */ #define __rpc_thread_svc_pollfd __rpc_thread_svc_pollfd_internal 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..1972bcf99 100644 --- a/libc/inet/rpc/svc_tcp.c +++ b/libc/inet/rpc/svc_tcp.c @@ -48,7 +48,13 @@ 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 poll __poll +#define accept __accept +#define listen __listen #define __FORCE_GLIBC #define _GNU_SOURCE @@ -163,7 +169,7 @@ svctcp_create (int sock, u_int sendsize, u_int recvsize) if (sock == RPC_ANYSOCK) { - if ((sock = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) + if ((sock = __socket (AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) { __perror (_("svc_tcp.c - tcp socket creation problem")); return (SVCXPRT *) NULL; diff --git a/libc/inet/rpc/svc_udp.c b/libc/inet/rpc/svc_udp.c index 197084144..62719ee33 100644 --- a/libc/inet/rpc/svc_udp.c +++ b/libc/inet/rpc/svc_udp.c @@ -40,10 +40,18 @@ 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 recvfrom __recvfrom +#define sendto __sendto +#define recvmsg __recvmsg +#define sendmsg __sendmsg #define __FORCE_GLIBC #define _GNU_SOURCE @@ -131,7 +139,7 @@ __svcudp_bufcreate (int sock, u_int sendsz, u_int recvsz) if (sock == RPC_ANYSOCK) { - if ((sock = socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) + if ((sock = __socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) { __perror (_("svcudp_create: socket creation problem")); return (SVCXPRT *) NULL; diff --git a/libc/inet/rpc/svc_unix.c b/libc/inet/rpc/svc_unix.c index 79c27ac5f..95a65ad1f 100644 --- a/libc/inet/rpc/svc_unix.c +++ b/libc/inet/rpc/svc_unix.c @@ -44,9 +44,17 @@ #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 recvmsg __recvmsg +#define sendmsg __sendmsg +#define poll __poll +#define accept __accept +#define listen __listen #define __FORCE_GLIBC #include <features.h> @@ -158,7 +166,7 @@ svcunix_create (int sock, u_int sendsize, u_int recvsize, char *path) if (sock == RPC_ANYSOCK) { - if ((sock = socket (AF_UNIX, SOCK_STREAM, 0)) < 0) + if ((sock = __socket (AF_UNIX, SOCK_STREAM, 0)) < 0) { __perror (_("svc_unix.c - AF_UNIX socket creation problem")); return (SVCXPRT *) NULL; diff --git a/libc/inet/rpc/xdr.c b/libc/inet/rpc/xdr.c index 3d36c4021..12315fdb5 100644 --- a/libc/inet/rpc/xdr.c +++ b/libc/inet/rpc/xdr.c @@ -728,6 +728,7 @@ __xdr_string (XDR *xdrs, char **cpp, u_int maxsize) } return FALSE; } +strong_alias(__xdr_string,xdr_string) /* * Wrapper for xdr_string that can be called directly from diff --git a/libc/inet/rpc/xdr_stdio.c b/libc/inet/rpc/xdr_stdio.c index 411cf17da..bd9ee4f1b 100644 --- a/libc/inet/rpc/xdr_stdio.c +++ b/libc/inet/rpc/xdr_stdio.c @@ -37,6 +37,9 @@ * from the stream. */ +#define fread __fread +#define fwrite __fwrite + #include <rpc/types.h> #include <stdio.h> #include <rpc/xdr.h> diff --git a/libc/inet/socketcalls.c b/libc/inet/socketcalls.c index 1dbffa3d1..d6ec86e94 100644 --- a/libc/inet/socketcalls.c +++ b/libc/inet/socketcalls.c @@ -43,14 +43,16 @@ int __libc_accept(int s, struct sockaddr *addr, socklen_t * addrlen) return __socketcall(SYS_ACCEPT, args); } #endif -weak_alias(__libc_accept, accept); +hidden_weak_alias(__libc_accept,__accept) +weak_alias(__libc_accept,accept) #endif #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); #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]; @@ -60,6 +62,7 @@ int bind(int sockfd, const struct sockaddr *myaddr, socklen_t addrlen) return __socketcall(SYS_BIND, args); } #endif +strong_alias(__bind,bind) #endif #ifdef L_connect @@ -77,7 +80,8 @@ int __libc_connect(int sockfd, const struct sockaddr *saddr, socklen_t addrlen) return __socketcall(SYS_CONNECT, args); } #endif -weak_alias(__libc_connect, connect); +hidden_weak_alias(__libc_connect,__connect) +weak_alias(__libc_connect,connect) #endif #ifdef L_getpeername @@ -100,7 +104,6 @@ int getpeername(int sockfd, struct sockaddr *addr, socklen_t * paddrlen) #ifdef __NR_getsockname #define __NR___getsockname __NR_getsockname attribute_hidden _syscall3(int, __getsockname, int, sockfd, struct sockaddr *, addr, socklen_t *,paddrlen); -strong_alias(__getsockname,getsockname) #elif defined(__NR_socketcall) int attribute_hidden __getsockname(int sockfd, struct sockaddr *addr, socklen_t * paddrlen) { @@ -111,8 +114,8 @@ int attribute_hidden __getsockname(int sockfd, struct sockaddr *addr, socklen_t args[2] = (unsigned long) paddrlen; return __socketcall(SYS_GETSOCKNAME, args); } -strong_alias(__getsockname,getsockname) #endif +strong_alias(__getsockname,getsockname) #endif #ifdef L_getsockopt @@ -136,9 +139,10 @@ int getsockopt(int fd, int level, int optname, __ptr_t optval, #ifdef L_listen #ifdef __NR_listen -_syscall2(int, listen, int, sockfd, int, backlog); +#define __NR___listen __NR_listen +attribute_hidden _syscall2(int, __listen, int, sockfd, int, backlog); #elif defined(__NR_socketcall) -int listen(int sockfd, int backlog) +int attribute_hidden __listen(int sockfd, int backlog) { unsigned long args[2]; @@ -147,6 +151,7 @@ int listen(int sockfd, int backlog) return __socketcall(SYS_LISTEN, args); } #endif +strong_alias(__listen,listen) #endif #ifdef L_recv @@ -166,14 +171,14 @@ ssize_t __libc_recv(int sockfd, __ptr_t buffer, size_t len, int flags) args[3] = flags; return (__socketcall(SYS_RECV, args)); } -weak_alias(__libc_recv, recv); #elif defined(__NR_recvfrom) ssize_t __libc_recv(int sockfd, __ptr_t buffer, size_t len, int flags) { - return (recvfrom(sockfd, buffer, len, flags, NULL, NULL)); + return (__recvfrom(sockfd, buffer, len, flags, NULL, NULL)); } -weak_alias(__libc_recv, recv); #endif +hidden_weak_alias(__libc_recv,__recv) +weak_alias(__libc_recv,recv) #endif #ifdef L_recvfrom @@ -197,7 +202,8 @@ ssize_t __libc_recvfrom(int sockfd, __ptr_t buffer, size_t len, int flags, return (__socketcall(SYS_RECVFROM, args)); } #endif -weak_alias(__libc_recvfrom, recvfrom); +hidden_weak_alias(__libc_recvfrom,__recvfrom) +weak_alias(__libc_recvfrom,recvfrom) #endif #ifdef L_recvmsg @@ -215,14 +221,14 @@ ssize_t __libc_recvmsg(int sockfd, struct msghdr *msg, int flags) return (__socketcall(SYS_RECVMSG, args)); } #endif -weak_alias(__libc_recvmsg, recvmsg); +hidden_weak_alias(__libc_recvmsg,__recvmsg) +weak_alias(__libc_recvmsg,recvmsg) #endif #ifdef L_send #ifdef __NR_send #define __NR___libc_send __NR_send _syscall4(ssize_t, __libc_send, int, sockfd, const void *, buffer, size_t, len, int, flags); -weak_alias(__libc_send, send); #elif defined(__NR_socketcall) /* send, sendto added by bir7@leland.stanford.edu */ ssize_t __libc_send(int sockfd, const void *buffer, size_t len, int flags) @@ -235,14 +241,18 @@ ssize_t __libc_send(int sockfd, const void *buffer, size_t len, int flags) args[3] = flags; return (__socketcall(SYS_SEND, args)); } -weak_alias(__libc_send, send); #elif defined(__NR_sendto) +extern ssize_t __sendto (int __fd, __const void *__buf, size_t __n, + int __flags, __CONST_SOCKADDR_ARG __addr, + socklen_t __addr_len) attribute_hidden; + ssize_t __libc_send(int sockfd, const void *buffer, size_t len, int flags) { - return (sendto(sockfd, buffer, len, flags, NULL, 0)); + return (__sendto(sockfd, buffer, len, flags, NULL, 0)); } -weak_alias(__libc_send, send); #endif +hidden_weak_alias(__libc_send,__send) +weak_alias(__libc_send,send) #endif #ifdef L_sendmsg @@ -260,7 +270,8 @@ ssize_t __libc_sendmsg(int sockfd, const struct msghdr *msg, int flags) return (__socketcall(SYS_SENDMSG, args)); } #endif -weak_alias(__libc_sendmsg, sendmsg); +hidden_weak_alias(__libc_sendmsg,__sendmsg) +weak_alias(__libc_sendmsg,sendmsg) #endif #ifdef L_sendto @@ -284,15 +295,17 @@ ssize_t __libc_sendto(int sockfd, const void *buffer, size_t len, int flags, return (__socketcall(SYS_SENDTO, args)); } #endif -weak_alias(__libc_sendto, sendto); +hidden_weak_alias(__libc_sendto,__sendto) +weak_alias(__libc_sendto,sendto) #endif #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); #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]; @@ -305,6 +318,7 @@ int setsockopt(int fd, int level, int optname, const void *optval, return (__socketcall(SYS_SETSOCKOPT, args)); } #endif +strong_alias(__setsockopt,setsockopt) #endif #ifdef L_shutdown @@ -325,9 +339,10 @@ int shutdown(int sockfd, int how) #ifdef L_socket #ifdef __NR_socket -_syscall3(int, socket, int, family, int, type, int, protocol); +#define __NR___socket __NR_socket +attribute_hidden _syscall3(int, __socket, int, family, int, type, int, protocol); #elif defined(__NR_socketcall) -int socket(int family, int type, int protocol) +int attribute_hidden __socket(int family, int type, int protocol) { unsigned long args[3]; @@ -337,6 +352,7 @@ int socket(int family, int type, int protocol) return __socketcall(SYS_SOCKET, args); } #endif +strong_alias(__socket,socket) #endif #ifdef L_socketpair @@ -355,4 +371,3 @@ int socketpair(int family, int type, int protocol, int sockvec[2]) } #endif #endif - |