From af0172162f7c653cad6a11ed1c1a5459bc154465 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Sat, 14 Jan 2006 00:58:03 +0000 Subject: hidden_def/hidden_proto: convert all users (I hope) termios split, add some missing headers, other jump relocs removed --- libc/inet/addr.c | 45 +++--- libc/inet/ether_addr.c | 19 +-- libc/inet/getaddrinfo.c | 114 ++++++++------- libc/inet/getnetbyad.c | 8 +- libc/inet/getnetbynm.c | 13 +- libc/inet/getnetent.c | 25 ++-- libc/inet/getproto.c | 60 ++++---- libc/inet/getservice.c | 69 +++++---- libc/inet/herror.c | 7 +- libc/inet/hostid.c | 32 +++-- libc/inet/if_index.c | 57 ++++---- libc/inet/ifaddrs.c | 31 ++-- libc/inet/in6_addr.c | 6 +- libc/inet/inet_net.c | 7 +- libc/inet/ntop.c | 37 +++-- libc/inet/opensock.c | 6 +- libc/inet/resolv.c | 315 ++++++++++++++++++++--------------------- libc/inet/rpc/auth_none.c | 13 +- libc/inet/rpc/auth_unix.c | 50 ++++--- libc/inet/rpc/authunix_prot.c | 18 +-- libc/inet/rpc/bindresvport.c | 17 ++- libc/inet/rpc/clnt_generic.c | 30 ++-- libc/inet/rpc/clnt_perror.c | 101 +++++++------ libc/inet/rpc/clnt_raw.c | 19 +-- libc/inet/rpc/clnt_simple.c | 18 ++- libc/inet/rpc/clnt_tcp.c | 64 +++++---- libc/inet/rpc/clnt_udp.c | 79 ++++++----- libc/inet/rpc/clnt_unix.c | 71 +++++----- libc/inet/rpc/create_xid.c | 8 +- libc/inet/rpc/get_myaddress.c | 28 ++-- libc/inet/rpc/getrpcent.c | 96 +++++++------ libc/inet/rpc/getrpcport.c | 9 +- libc/inet/rpc/pmap_clnt.c | 53 ++++--- libc/inet/rpc/pmap_getmaps.c | 6 +- libc/inet/rpc/pmap_getport.c | 15 +- libc/inet/rpc/pmap_prot.c | 3 +- libc/inet/rpc/pmap_prot2.c | 5 +- libc/inet/rpc/pmap_rmt.c | 74 +++++----- libc/inet/rpc/rcmd.c | 159 ++++++++++++--------- libc/inet/rpc/rexec.c | 95 +++++++------ libc/inet/rpc/rpc_callmsg.c | 28 ++-- libc/inet/rpc/rpc_dtablesize.c | 11 +- libc/inet/rpc/rpc_private.h | 5 +- libc/inet/rpc/rpc_prot.c | 52 ++++--- libc/inet/rpc/rpc_thread.c | 48 ++++--- libc/inet/rpc/rtime.c | 19 +-- libc/inet/rpc/ruserpass.c | 123 +++++++++------- libc/inet/rpc/svc.c | 131 +++++++++-------- libc/inet/rpc/svc_auth.c | 7 +- libc/inet/rpc/svc_auth_unix.c | 12 +- libc/inet/rpc/svc_raw.c | 8 +- libc/inet/rpc/svc_run.c | 16 +-- libc/inet/rpc/svc_simple.c | 34 +++-- libc/inet/rpc/svc_tcp.c | 59 ++++---- libc/inet/rpc/svc_udp.c | 78 +++++----- libc/inet/rpc/svc_unix.c | 72 +++++----- libc/inet/rpc/xdr.c | 137 ++++++++++-------- libc/inet/rpc/xdr_array.c | 19 +-- libc/inet/rpc/xdr_mem.c | 13 +- libc/inet/rpc/xdr_rec.c | 43 +++--- libc/inet/rpc/xdr_reference.c | 21 +-- libc/inet/rpc/xdr_stdio.c | 12 +- libc/inet/socketcalls.c | 98 +++++++------ 63 files changed, 1607 insertions(+), 1321 deletions(-) (limited to 'libc/inet') diff --git a/libc/inet/addr.c b/libc/inet/addr.c index 6be41f81d..7c73e2a88 100644 --- a/libc/inet/addr.c +++ b/libc/inet/addr.c @@ -42,7 +42,7 @@ * leading 0 -> octal * all else -> decimal */ -int attribute_hidden __inet_aton(const char *cp, struct in_addr *addrptr) +int inet_aton(const char *cp, struct in_addr *addrptr) { in_addr_t addr; int value; @@ -88,29 +88,32 @@ int attribute_hidden __inet_aton(const char *cp, struct in_addr *addrptr) return 1; } -strong_alias(__inet_aton,inet_aton) +libc_hidden_proto(inet_aton) +libc_hidden_def(inet_aton) #endif #ifdef L_inet_addr -extern int __inet_aton (__const char *__cp, struct in_addr *__inp) __THROW attribute_hidden; +#include +libc_hidden_proto(inet_aton) -in_addr_t attribute_hidden __inet_addr(const char *cp) +in_addr_t 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) +libc_hidden_proto(inet_addr) +libc_hidden_def(inet_addr) #endif #ifdef L_inet_ntoa #define INET_NTOA_MAX_LEN 16 /* max 12 digits + 3 '.'s + 1 nul */ -char attribute_hidden *__inet_ntoa_r(struct in_addr in, char buf[INET_NTOA_MAX_LEN]) +char *inet_ntoa_r(struct in_addr in, char buf[INET_NTOA_MAX_LEN]) { in_addr_t addr = ntohl(in.s_addr); int i; @@ -129,22 +132,28 @@ char attribute_hidden *__inet_ntoa_r(struct in_addr in, char buf[INET_NTOA_MAX_L return p+1; } -strong_alias(__inet_ntoa_r,inet_ntoa_r) +libc_hidden_proto(inet_ntoa_r) +libc_hidden_def(inet_ntoa_r) -char attribute_hidden *__inet_ntoa(struct in_addr in) +char *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) +libc_hidden_proto(inet_ntoa) +libc_hidden_def(inet_ntoa) #endif #ifdef L_inet_makeaddr + +/* for some reason it does not remove the jump relocation */ +libc_hidden_proto(memmove) + /* * Formulate an Internet address from network + host. Used in * building addresses stored in the ifnet structure. */ -struct in_addr attribute_hidden __inet_makeaddr(in_addr_t net, in_addr_t host) +struct in_addr inet_makeaddr(in_addr_t net, in_addr_t host) { in_addr_t addr; @@ -159,8 +168,8 @@ struct in_addr attribute_hidden __inet_makeaddr(in_addr_t net, in_addr_t host) addr = htonl(addr); return (*(struct in_addr *)&addr); } -strong_alias(__inet_makeaddr,inet_makeaddr) - +libc_hidden_proto(inet_makeaddr) +libc_hidden_def(inet_makeaddr) #endif #ifdef L_inet_lnaof @@ -188,8 +197,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 attribute_hidden -__inet_netof(struct in_addr in) +in_addr_t +inet_netof(struct in_addr in) { in_addr_t i = ntohl(in.s_addr); @@ -200,6 +209,6 @@ __inet_netof(struct in_addr in) else return (((i)&IN_CLASSC_NET) >> IN_CLASSC_NSHIFT); } -strong_alias(__inet_netof,inet_netof) - +libc_hidden_proto(inet_netof) +libc_hidden_def(inet_netof) #endif diff --git a/libc/inet/ether_addr.c b/libc/inet/ether_addr.c index 0a1e2aede..8be160a0d 100644 --- a/libc/inet/ether_addr.c +++ b/libc/inet/ether_addr.c @@ -23,7 +23,6 @@ * - initial uClibc port */ - #define __FORCE_GLIBC #include #include @@ -32,7 +31,11 @@ #include #include -struct ether_addr attribute_hidden *__ether_aton_r(const char *asc, struct ether_addr *addr) +libc_hidden_proto(ether_aton_r) +libc_hidden_proto(ether_ntoa_r) +libc_hidden_proto(sprintf) + +struct ether_addr *ether_aton_r(const char *asc, struct ether_addr *addr) { size_t cnt; @@ -68,28 +71,28 @@ struct ether_addr attribute_hidden *__ether_aton_r(const char *asc, struct ether return addr; } -strong_alias(__ether_aton_r,ether_aton_r) +libc_hidden_def(ether_aton_r) struct ether_addr *ether_aton(const char *asc) { static struct ether_addr result; - return __ether_aton_r(asc, &result); + return ether_aton_r(asc, &result); } -char attribute_hidden *__ether_ntoa_r(const struct ether_addr *addr, char *buf) +char *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) +libc_hidden_def(ether_ntoa_r) char *ether_ntoa(const struct ether_addr *addr) { static char asc[18]; - return __ether_ntoa_r(addr, asc); + return ether_ntoa_r(addr, asc); } diff --git a/libc/inet/getaddrinfo.c b/libc/inet/getaddrinfo.c index cc348661a..225bc75c6 100644 --- a/libc/inet/getaddrinfo.c +++ b/libc/inet/getaddrinfo.c @@ -1,3 +1,10 @@ +/* + * Copyright 1996 by Craig Metz + * Copyright (C) 2000-2006 Erik Andersen + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ + /* $USAGI: getaddrinfo.c,v 1.16 2001/10/04 09:52:03 sekiya Exp $ */ /* The Inner Net License, Version 2.00 @@ -42,24 +49,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. If these license terms cause you a real problem, contact the author. */ -/* This software is Copyright 1996 by Craig Metz, All Rights Reserved. */ - -#define getservbyname_r __getservbyname_r -#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 -#define if_nametoindex __if_nametoindex -#if 0 -#define uname __uname -#define stpcpy __stpcpy -/* strdupa is using these */ -#define memcpy __memcpy -#define strlen __strlen -#endif - #define _GNU_SOURCE #define __FORCE_GLIBC #include @@ -79,6 +68,28 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include +libc_hidden_proto(memcpy) +libc_hidden_proto(memset) +/* libc_hidden_proto(strcmp) */ +/* libc_hidden_proto(stpcpy) */ +libc_hidden_proto(strchr) +libc_hidden_proto(strcpy) +libc_hidden_proto(strlen) +libc_hidden_proto(socket) +libc_hidden_proto(close) +libc_hidden_proto(getservbyname_r) +libc_hidden_proto(gethostbyname_r) +libc_hidden_proto(gethostbyname2_r) +libc_hidden_proto(gethostbyaddr_r) +libc_hidden_proto(inet_pton) +libc_hidden_proto(inet_ntop) +libc_hidden_proto(strtoul) +libc_hidden_proto(if_nametoindex) +/* libc_hidden_proto(uname) */ +#ifdef __UCLIBC_HAS_IPV6__ +libc_hidden_proto(in6addr_loopback) +#endif + /* The following declarations and definitions have been removed from * the public header since we don't want people to use them. */ #define AI_V4MAPPED 0x0008 /* IPv4-mapped addresses are acceptable. */ @@ -160,12 +171,12 @@ 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 { - __close(s); + close(s); ret = 1; } __set_errno (saved_errno); @@ -189,10 +200,10 @@ gaih_local (const char *name, const struct gaih_service *service, if (name != NULL) { - if (__strcmp(name, "localhost") && - __strcmp(name, "local") && - __strcmp(name, "unix") && - __strcmp(name, utsname.nodename)) + if (strcmp(name, "localhost") && + strcmp(name, "local") && + strcmp(name, "unix") && + strcmp(name, utsname.nodename)) return GAIH_OKIFUNSPEC | -EAI_NONAME; } @@ -219,7 +230,7 @@ gaih_local (const char *name, const struct gaih_service *service, *pai = malloc (sizeof (struct addrinfo) + sizeof (struct sockaddr_un) + ((req->ai_flags & AI_CANONNAME) - ? (__strlen(utsname.nodename) + 1): 0)); + ? (strlen(utsname.nodename) + 1): 0)); if (*pai == NULL) return -EAI_MEMORY; @@ -237,22 +248,22 @@ gaih_local (const char *name, const struct gaih_service *service, #endif /* SALEN */ ((struct sockaddr_un *)(*pai)->ai_addr)->sun_family = AF_LOCAL; - __memset(((struct sockaddr_un *)(*pai)->ai_addr)->sun_path, 0, UNIX_PATH_MAX); + memset(((struct sockaddr_un *)(*pai)->ai_addr)->sun_path, 0, UNIX_PATH_MAX); if (service) { struct sockaddr_un *sunp = (struct sockaddr_un *) (*pai)->ai_addr; - if (__strchr (service->name, '/') != NULL) + if (strchr (service->name, '/') != NULL) { - if (__strlen (service->name) >= sizeof (sunp->sun_path)) + if (strlen (service->name) >= sizeof (sunp->sun_path)) return GAIH_OKIFUNSPEC | -EAI_SERVICE; - __strcpy (sunp->sun_path, service->name); + strcpy (sunp->sun_path, service->name); } else { - if (__strlen (P_tmpdir "/") + 1 + __strlen (service->name) >= + if (strlen (P_tmpdir "/") + 1 + strlen (service->name) >= sizeof (sunp->sun_path)) return GAIH_OKIFUNSPEC | -EAI_SERVICE; @@ -274,7 +285,7 @@ gaih_local (const char *name, const struct gaih_service *service, } if (req->ai_flags & AI_CANONNAME) - (*pai)->ai_canonname = __strcpy ((char *) *pai + sizeof (struct addrinfo) + (*pai)->ai_canonname = strcpy ((char *) *pai + sizeof (struct addrinfo) + sizeof (struct sockaddr_un), utsname.nodename); else @@ -354,7 +365,7 @@ gaih_inet_serv (const char *servicename, const struct gaih_typeproto *tp, } \ (*pat)->next = NULL; \ (*pat)->family = _family; \ - __memcpy ((*pat)->addr, h->h_addr_list[i], \ + memcpy ((*pat)->addr, h->h_addr_list[i], \ sizeof(_type)); \ pat = &((*pat)->next); \ } \ @@ -505,7 +516,7 @@ gaih_inet (const char *name, const struct gaih_service *service, char *namebuf = strdupa (name); char *scope_delim; - scope_delim = __strchr (namebuf, SCOPE_DELIMITER); + scope_delim = strchr (namebuf, SCOPE_DELIMITER); if (scope_delim != NULL) *scope_delim = '\0'; @@ -588,21 +599,20 @@ gaih_inet (const char *name, const struct gaih_service *service, { struct gaih_addrtuple *atr; atr = at = alloca (sizeof (struct gaih_addrtuple)); - __memset (at, '\0', sizeof (struct gaih_addrtuple)); + memset (at, '\0', sizeof (struct gaih_addrtuple)); if (req->ai_family == 0) { at->next = alloca (sizeof (struct gaih_addrtuple)); - __memset (at->next, '\0', sizeof (struct gaih_addrtuple)); + memset (at->next, '\0', sizeof (struct gaih_addrtuple)); } #if __UCLIBC_HAS_IPV6__ if (req->ai_family == 0 || req->ai_family == AF_INET6) { - extern const struct in6_addr __in6addr_loopback attribute_hidden; at->family = AF_INET6; if ((req->ai_flags & AI_PASSIVE) == 0) - __memcpy (at->addr, &__in6addr_loopback, sizeof (struct in6_addr)); + memcpy (at->addr, &in6addr_loopback, sizeof (struct in6_addr)); atr = at->next; } #endif @@ -674,7 +684,7 @@ gaih_inet (const char *name, const struct gaih_service *service, if (c == NULL) return GAIH_OKIFUNSPEC | -EAI_NONAME; - namelen = __strlen (c) + 1; + namelen = strlen (c) + 1; } else namelen = 0; @@ -718,7 +728,7 @@ gaih_inet (const char *name, const struct gaih_service *service, sin6p->sin6_flowinfo = 0; if (at2->family == AF_INET6) { - __memcpy (&sin6p->sin6_addr, + memcpy (&sin6p->sin6_addr, at2->addr, sizeof (struct in6_addr)); } else @@ -726,7 +736,7 @@ gaih_inet (const char *name, const struct gaih_service *service, sin6p->sin6_addr.s6_addr32[0] = 0; sin6p->sin6_addr.s6_addr32[1] = 0; sin6p->sin6_addr.s6_addr32[2] = htonl(0x0000ffff); - __memcpy(&sin6p->sin6_addr.s6_addr32[3], + memcpy(&sin6p->sin6_addr.s6_addr32[3], at2->addr, sizeof (sin6p->sin6_addr.s6_addr32[3])); } sin6p->sin6_port = st2->port; @@ -738,17 +748,17 @@ gaih_inet (const char *name, const struct gaih_service *service, struct sockaddr_in *sinp = (struct sockaddr_in *) (*pai)->ai_addr; - __memcpy (&sinp->sin_addr, + memcpy (&sinp->sin_addr, at2->addr, sizeof (struct in_addr)); sinp->sin_port = st2->port; - __memset (sinp->sin_zero, '\0', sizeof (sinp->sin_zero)); + memset (sinp->sin_zero, '\0', sizeof (sinp->sin_zero)); } if (c) { (*pai)->ai_canonname = ((void *) (*pai) + sizeof (struct addrinfo) + socklen); - __strcpy ((*pai)->ai_canonname, c); + strcpy ((*pai)->ai_canonname, c); } else (*pai)->ai_canonname = NULL; @@ -775,8 +785,8 @@ static struct gaih gaih[] = { PF_UNSPEC, NULL } }; -void attribute_hidden -__freeaddrinfo (struct addrinfo *ai) +void +freeaddrinfo (struct addrinfo *ai) { struct addrinfo *p; @@ -787,10 +797,11 @@ __freeaddrinfo (struct addrinfo *ai) free (p); } } -strong_alias(__freeaddrinfo,freeaddrinfo) +libc_hidden_proto(freeaddrinfo) +libc_hidden_def(freeaddrinfo) -int attribute_hidden -__getaddrinfo (const char *name, const char *service, +int +getaddrinfo (const char *name, const char *service, const struct addrinfo *hints, struct addrinfo **pai) { int i = 0, j = 0, last_i = 0; @@ -860,7 +871,7 @@ __getaddrinfo (const char *name, const char *service, continue; if (p) - __freeaddrinfo (p); + freeaddrinfo (p); return -(i & GAIH_EAI); } @@ -884,8 +895,9 @@ __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) +libc_hidden_proto(getaddrinfo) +libc_hidden_def(getaddrinfo) diff --git a/libc/inet/getnetbyad.c b/libc/inet/getnetbyad.c index f0c661faa..e353f245b 100644 --- a/libc/inet/getnetbyad.c +++ b/libc/inet/getnetbyad.c @@ -15,14 +15,14 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#define setnetent __setnetent -#define getnetent __getnetent -#define endnetent __endnetent - #define __FORCE_GLIBC #include #include +libc_hidden_proto(setnetent) +libc_hidden_proto(getnetent) +libc_hidden_proto(endnetent) + extern int _net_stayopen attribute_hidden; struct netent *getnetbyaddr (uint32_t net, int type) diff --git a/libc/inet/getnetbynm.c b/libc/inet/getnetbynm.c index ef3d06137..97d5cb85f 100644 --- a/libc/inet/getnetbynm.c +++ b/libc/inet/getnetbynm.c @@ -15,15 +15,16 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#define setnetent __setnetent -#define getnetent __getnetent -#define endnetent __endnetent - #define __FORCE_GLIBC #include #include #include +libc_hidden_proto(strcmp) +libc_hidden_proto(setnetent) +libc_hidden_proto(getnetent) +libc_hidden_proto(endnetent) + extern int _net_stayopen attribute_hidden; struct netent * @@ -34,10 +35,10 @@ getnetbyname(const char *name) setnetent(_net_stayopen); while ((p = getnetent())) { - if (__strcmp(p->n_name, name) == 0) + if (strcmp(p->n_name, name) == 0) break; for (cp = p->n_aliases; *cp != 0; cp++) - if (__strcmp(*cp, name) == 0) + if (strcmp(*cp, name) == 0) goto found; } found: diff --git a/libc/inet/getnetent.c b/libc/inet/getnetent.c index 77ecc4275..4413811a3 100644 --- a/libc/inet/getnetent.c +++ b/libc/inet/getnetent.c @@ -15,10 +15,6 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#define inet_network __inet_network -#define rewind __rewind -#define fgets __fgets - #define __FORCE_GLIBC #include #include @@ -26,6 +22,12 @@ #include #include +libc_hidden_proto(fopen) +libc_hidden_proto(fclose) +libc_hidden_proto(inet_network) +libc_hidden_proto(rewind) +libc_hidden_proto(fgets) +libc_hidden_proto(abort) #ifdef __UCLIBC_HAS_THREADS__ # include @@ -45,7 +47,7 @@ static char *net_aliases[MAXALIASES]; int _net_stayopen attribute_hidden; -void attribute_hidden __setnetent(int f) +void setnetent(int f) { LOCK; if (netf == NULL) @@ -56,9 +58,10 @@ void attribute_hidden __setnetent(int f) UNLOCK; return; } -strong_alias(__setnetent,setnetent) +libc_hidden_proto(setnetent) +libc_hidden_def(setnetent) -void attribute_hidden __endnetent(void) +void endnetent(void) { LOCK; if (netf) { @@ -68,7 +71,8 @@ void attribute_hidden __endnetent(void) _net_stayopen = 0; UNLOCK; } -strong_alias(__endnetent,endnetent) +libc_hidden_proto(endnetent) +libc_hidden_def(endnetent) static char * any(register char *cp, char *match) { @@ -83,7 +87,7 @@ static char * any(register char *cp, char *match) return ((char *)0); } -struct netent attribute_hidden * __getnetent(void) +struct netent *getnetent(void) { char *p; register char *cp, **q; @@ -142,4 +146,5 @@ again: UNLOCK; return (&net); } -strong_alias(__getnetent,getnetent) +libc_hidden_proto(getnetent) +libc_hidden_def(getnetent) diff --git a/libc/inet/getproto.c b/libc/inet/getproto.c index 008b0d606..e5a11d2c7 100644 --- a/libc/inet/getproto.c +++ b/libc/inet/getproto.c @@ -51,11 +51,6 @@ ** SUCH DAMAGE. */ -#define strpbrk __strpbrk -#define atoi __atoi -#define rewind __rewind -#define fgets __fgets - #define __FORCE_GLIBC #define _GNU_SOURCE #include @@ -67,6 +62,14 @@ #include #include +libc_hidden_proto(fopen) +libc_hidden_proto(strcmp) +libc_hidden_proto(strpbrk) +libc_hidden_proto(atoi) +libc_hidden_proto(rewind) +libc_hidden_proto(fgets) +libc_hidden_proto(fclose) +libc_hidden_proto(abort) #ifdef __UCLIBC_HAS_THREADS__ # include @@ -94,7 +97,7 @@ static void __initbuf(void) } } -void attribute_hidden __setprotoent(int f) +void setprotoent(int f) { LOCK; if (protof == NULL) @@ -104,9 +107,10 @@ void attribute_hidden __setprotoent(int f) proto_stayopen |= f; UNLOCK; } -strong_alias(__setprotoent,setprotoent) +libc_hidden_proto(setprotoent) +libc_hidden_def(setprotoent) -void attribute_hidden __endprotoent(void) +void endprotoent(void) { LOCK; if (protof) { @@ -116,9 +120,10 @@ void attribute_hidden __endprotoent(void) proto_stayopen = 0; UNLOCK; } -strong_alias(__endprotoent,endprotoent) +libc_hidden_proto(endprotoent) +libc_hidden_def(endprotoent) -int attribute_hidden __getprotoent_r(struct protoent *result_buf, +int getprotoent_r(struct protoent *result_buf, char *buf, size_t buflen, struct protoent **result) { @@ -194,19 +199,20 @@ again: UNLOCK; return 0; } -strong_alias(__getprotoent_r,getprotoent_r) +libc_hidden_proto(getprotoent_r) +libc_hidden_def(getprotoent_r) struct protoent * getprotoent(void) { struct protoent *result; __initbuf(); - __getprotoent_r(&proto, static_aliases, SBUFSIZE, &result); + getprotoent_r(&proto, static_aliases, SBUFSIZE, &result); return result; } -int attribute_hidden __getprotobyname_r(const char *name, +int getprotobyname_r(const char *name, struct protoent *result_buf, char *buf, size_t buflen, struct protoent **result) @@ -215,21 +221,22 @@ int attribute_hidden __getprotobyname_r(const char *name, int ret; LOCK; - __setprotoent(proto_stayopen); - while (!(ret=__getprotoent_r(result_buf, buf, buflen, result))) { - if (__strcmp(result_buf->p_name, name) == 0) + setprotoent(proto_stayopen); + while (!(ret=getprotoent_r(result_buf, buf, buflen, result))) { + if (strcmp(result_buf->p_name, name) == 0) break; for (cp = result_buf->p_aliases; *cp != 0; cp++) - if (__strcmp(*cp, name) == 0) + if (strcmp(*cp, name) == 0) goto found; } found: if (!proto_stayopen) - __endprotoent(); + endprotoent(); UNLOCK; return *result?0:ret; } -strong_alias(__getprotobyname_r,getprotobyname_r) +libc_hidden_proto(getprotobyname_r) +libc_hidden_def(getprotobyname_r) struct protoent * getprotobyname(const char *name) @@ -237,12 +244,12 @@ struct protoent * getprotobyname(const char *name) struct protoent *result; __initbuf(); - __getprotobyname_r(name, &proto, static_aliases, SBUFSIZE, &result); + getprotobyname_r(name, &proto, static_aliases, SBUFSIZE, &result); return result; } -int attribute_hidden __getprotobynumber_r (int proto_num, +int getprotobynumber_r (int proto_num, struct protoent *result_buf, char *buf, size_t buflen, struct protoent **result) @@ -250,23 +257,24 @@ int attribute_hidden __getprotobynumber_r (int proto_num, int ret; LOCK; - __setprotoent(proto_stayopen); - while (!(ret=__getprotoent_r(result_buf, buf, buflen, result))) + setprotoent(proto_stayopen); + while (!(ret=getprotoent_r(result_buf, buf, buflen, result))) if (result_buf->p_proto == proto_num) break; if (!proto_stayopen) - __endprotoent(); + endprotoent(); UNLOCK; return *result?0:ret; } -strong_alias(__getprotobynumber_r,getprotobynumber_r) +libc_hidden_proto(getprotobynumber_r) +libc_hidden_def(getprotobynumber_r) struct protoent * getprotobynumber(int proto_num) { struct protoent *result; __initbuf(); - __getprotobynumber_r(proto_num, &proto, static_aliases, + getprotobynumber_r(proto_num, &proto, static_aliases, SBUFSIZE, &result); return result; } diff --git a/libc/inet/getservice.c b/libc/inet/getservice.c index f3916de86..254f638f2 100644 --- a/libc/inet/getservice.c +++ b/libc/inet/getservice.c @@ -51,11 +51,6 @@ ** SUCH DAMAGE. */ -#define strpbrk __strpbrk -#define atoi __atoi -#define rewind __rewind -#define fgets __fgets - #define __FORCE_GLIBC #define _GNU_SOURCE #include @@ -69,6 +64,14 @@ #include #include +libc_hidden_proto(strcmp) +libc_hidden_proto(strpbrk) +libc_hidden_proto(fopen) +libc_hidden_proto(fclose) +libc_hidden_proto(atoi) +libc_hidden_proto(rewind) +libc_hidden_proto(fgets) +libc_hidden_proto(abort) #ifdef __UCLIBC_HAS_THREADS__ # include @@ -97,7 +100,7 @@ static void __initbuf(void) } } -extern void attribute_hidden __setservent(int f) +void setservent(int f) { LOCK; if (servf == NULL) @@ -107,9 +110,10 @@ extern void attribute_hidden __setservent(int f) serv_stayopen |= f; UNLOCK; } -strong_alias(__setservent,setservent) +libc_hidden_proto(setservent) +libc_hidden_def(setservent) -extern void attribute_hidden __endservent(void) +void endservent(void) { LOCK; if (servf) { @@ -119,9 +123,10 @@ extern void attribute_hidden __endservent(void) serv_stayopen = 0; UNLOCK; } -strong_alias(__endservent,endservent) +libc_hidden_proto(endservent) +libc_hidden_def(endservent) -extern int attribute_hidden __getservent_r(struct servent * result_buf, +int getservent_r(struct servent * result_buf, char * buf, size_t buflen, struct servent ** result) { @@ -200,18 +205,19 @@ again: UNLOCK; return 0; } -strong_alias(__getservent_r,getservent_r) +libc_hidden_proto(getservent_r) +libc_hidden_def(getservent_r) struct servent * getservent(void) { struct servent *result; __initbuf(); - __getservent_r(&serv, servbuf, SBUFSIZE, &result); + getservent_r(&serv, servbuf, SBUFSIZE, &result); return result; } -extern int attribute_hidden __getservbyname_r(const char *name, const char *proto, +int getservbyname_r(const char *name, const char *proto, struct servent * result_buf, char * buf, size_t buflen, struct servent ** result) { @@ -219,62 +225,65 @@ extern int attribute_hidden __getservbyname_r(const char *name, const char *prot int ret; LOCK; - __setservent(serv_stayopen); - while (!(ret=__getservent_r(result_buf, buf, buflen, result))) { - if (__strcmp(name, result_buf->s_name) == 0) + setservent(serv_stayopen); + while (!(ret=getservent_r(result_buf, buf, buflen, result))) { + if (strcmp(name, result_buf->s_name) == 0) goto gotname; for (cp = result_buf->s_aliases; *cp; cp++) - if (__strcmp(name, *cp) == 0) + if (strcmp(name, *cp) == 0) goto gotname; continue; gotname: - if (proto == 0 || __strcmp(result_buf->s_proto, proto) == 0) + if (proto == 0 || strcmp(result_buf->s_proto, proto) == 0) break; } if (!serv_stayopen) - __endservent(); + endservent(); UNLOCK; return *result?0:ret; } -strong_alias(__getservbyname_r,getservbyname_r) +libc_hidden_proto(getservbyname_r) +libc_hidden_def(getservbyname_r) struct servent *getservbyname(const char *name, const char *proto) { struct servent *result; __initbuf(); - __getservbyname_r(name, proto, &serv, servbuf, SBUFSIZE, &result); + getservbyname_r(name, proto, &serv, servbuf, SBUFSIZE, &result); return result; } -extern int attribute_hidden __getservbyport_r(int port, const char *proto, +int getservbyport_r(int port, const char *proto, struct servent * result_buf, char * buf, size_t buflen, struct servent ** result) { int ret; LOCK; - __setservent(serv_stayopen); - while (!(ret=__getservent_r(result_buf, buf, buflen, result))) { + setservent(serv_stayopen); + while (!(ret=getservent_r(result_buf, buf, buflen, result))) { if (result_buf->s_port != port) continue; - if (proto == 0 || __strcmp(result_buf->s_proto, proto) == 0) + if (proto == 0 || strcmp(result_buf->s_proto, proto) == 0) break; } if (!serv_stayopen) - __endservent(); + endservent(); UNLOCK; return *result?0:ret; } -strong_alias(__getservbyport_r,getservbyport_r) +libc_hidden_proto(getservbyport_r) +libc_hidden_def(getservbyport_r) -struct servent attribute_hidden * __getservbyport(int port, const char *proto) +struct servent * getservbyport(int port, const char *proto) { struct servent *result; __initbuf(); - __getservbyport_r(port, proto, &serv, servbuf, SBUFSIZE, &result); + getservbyport_r(port, proto, &serv, servbuf, SBUFSIZE, &result); return result; } -strong_alias(__getservbyport,getservbyport) +libc_hidden_proto(getservbyport) +libc_hidden_def(getservbyport) diff --git a/libc/inet/herror.c b/libc/inet/herror.c index 2f0797b91..6efbc2f93 100644 --- a/libc/inet/herror.c +++ b/libc/inet/herror.c @@ -23,6 +23,8 @@ #include #include +libc_hidden_proto(fprintf) + static const char *error_msg = "Resolver error"; static const char *const h_errlist[] = { "Error 0", @@ -36,7 +38,7 @@ static const int h_nerr = { sizeof(h_errlist)/sizeof(h_errlist[0]) }; /* * herror -- print the error indicated by the h_errno value. */ -void attribute_hidden __herror(const char *s) +void herror(const char *s) { static const char colon_space[] = ": "; const char *p; @@ -52,7 +54,8 @@ void attribute_hidden __herror(const char *s) } fprintf(stderr, "%s%s%s\n", s, c, p); } -strong_alias(__herror,herror) +libc_hidden_proto(herror) +libc_hidden_def(herror) const char *hstrerror(int err) diff --git a/libc/inet/hostid.c b/libc/inet/hostid.c index bc9576e74..4ac4a811f 100644 --- a/libc/inet/hostid.c +++ b/libc/inet/hostid.c @@ -1,7 +1,8 @@ -#define geteuid __geteuid -#define getuid __getuid -#define gethostbyname __gethostbyname -#define gethostname __gethostname +/* + * Copyright (C) 2000-2006 Erik Andersen + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ #define __FORCE_GLIBC #include @@ -14,6 +15,15 @@ #include #include +libc_hidden_proto(memcpy) +libc_hidden_proto(open) +libc_hidden_proto(close) +libc_hidden_proto(read) +libc_hidden_proto(write) +libc_hidden_proto(getuid) +libc_hidden_proto(geteuid) +libc_hidden_proto(gethostbyname) +libc_hidden_proto(gethostname) #define HOSTID "/etc/hostid" @@ -23,10 +33,10 @@ int sethostid(long int new_id) int ret; if (geteuid() || getuid()) return __set_errno(EPERM); - if ((fd=__open(HOSTID,O_CREAT|O_WRONLY,0644))<0) return -1; - ret = __write(fd,(void *)&new_id,sizeof(new_id)) == sizeof(new_id) + if ((fd=open(HOSTID,O_CREAT|O_WRONLY,0644))<0) return -1; + ret = write(fd,(void *)&new_id,sizeof(new_id)) == sizeof(new_id) ? 0 : -1; - __close (fd); + close (fd); return ret; } @@ -39,12 +49,12 @@ long int gethostid(void) * It is not an error if we cannot read this file. It is not even an * error if we cannot read all the bytes, we just carry on trying... */ - if ((fd=__open(HOSTID,O_RDONLY))>=0 && __read(fd,(void *)&id,sizeof(id))) + if ((fd=open(HOSTID,O_RDONLY))>=0 && read(fd,(void *)&id,sizeof(id))) { - __close (fd); + close (fd); return id; } - if (fd >= 0) __close (fd); + if (fd >= 0) close (fd); /* Try some methods of returning a unique 32 bit id. Clearly IP * numbers, if on the internet, will have a unique address. If they @@ -70,7 +80,7 @@ long int gethostid(void) */ return 0; else { - __memcpy((char *) &in, (char *) hp->h_addr, hp->h_length); + memcpy((char *) &in, (char *) hp->h_addr, hp->h_length); /* Just so it doesn't look exactly like the IP addr */ return(in.s_addr<<16|in.s_addr>>16); diff --git a/libc/inet/if_index.c b/libc/inet/if_index.c index 40e46d538..fd0b901a1 100644 --- a/libc/inet/if_index.c +++ b/libc/inet/if_index.c @@ -20,8 +20,6 @@ Reworked Dec 2002 by Erik Andersen */ -#define strndup __strndup - #define __FORCE_GLIBC #include #define __USE_GNU @@ -38,6 +36,12 @@ #include "netlinkaccess.h" +libc_hidden_proto(strndup) +libc_hidden_proto(strncpy) +libc_hidden_proto(strdup) +libc_hidden_proto(ioctl) +libc_hidden_proto(close) + extern int __opensock(void) attribute_hidden; unsigned int @@ -53,21 +57,22 @@ 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) + strncpy (ifr.ifr_name, ifname, sizeof (ifr.ifr_name)); + if (ioctl (fd, SIOCGIFINDEX, &ifr) < 0) { int saved_errno = errno; - __close(fd); + close(fd); if (saved_errno == EINVAL) __set_errno(ENOSYS); return 0; } - __close(fd); + close(fd); return ifr.ifr_ifindex; #endif } -hidden_strong_alias(if_nametoindex,__if_nametoindex) +libc_hidden_proto(if_nametoindex) +libc_hidden_def(if_nametoindex) void if_freenameindex (struct if_nameindex *ifn) @@ -80,7 +85,8 @@ if_freenameindex (struct if_nameindex *ifn) } free (ifn); } -hidden_strong_alias(if_freenameindex,__if_freenameindex) +libc_hidden_proto(if_freenameindex) +libc_hidden_def(if_freenameindex) #if !__ASSUME_NETLINK_SUPPORT struct if_nameindex * @@ -112,9 +118,9 @@ if_nameindex (void) ifc.ifc_buf = extend_alloca (ifc.ifc_buf, rq_len, 2 * rq_len); ifc.ifc_len = rq_len; - if (__ioctl (fd, SIOCGIFCONF, &ifc) < 0) + if (ioctl (fd, SIOCGIFCONF, &ifc) < 0) { - __close (fd); + close (fd); return NULL; } } @@ -125,7 +131,7 @@ if_nameindex (void) idx = malloc ((nifs + 1) * sizeof (struct if_nameindex)); if (idx == NULL) { - __close(fd); + close(fd); __set_errno(ENOBUFS); return NULL; } @@ -133,9 +139,9 @@ if_nameindex (void) for (i = 0; i < nifs; ++i) { struct ifreq *ifr = &ifc.ifc_req[i]; - idx[i].if_name = __strdup (ifr->ifr_name); + idx[i].if_name = strdup (ifr->ifr_name); if (idx[i].if_name == NULL - || __ioctl (fd, SIOCGIFINDEX, ifr) < 0) + || ioctl (fd, SIOCGIFINDEX, ifr) < 0) { int saved_errno = errno; unsigned int j; @@ -143,7 +149,7 @@ if_nameindex (void) for (j = 0; j < i; ++j) free (idx[j].if_name); free(idx); - __close(fd); + close(fd); if (saved_errno == EINVAL) saved_errno = ENOSYS; else if (saved_errno == ENOMEM) @@ -157,7 +163,7 @@ if_nameindex (void) idx[i].if_index = 0; idx[i].if_name = NULL; - __close(fd); + close(fd); return idx; #endif } @@ -248,11 +254,11 @@ if_nameindex (void) if (rta->rta_type == IFLA_IFNAME) { - idx[nifs].if_name = __strndup (rta_data, rta_payload); + idx[nifs].if_name = strndup (rta_data, rta_payload); if (idx[nifs].if_name == NULL) { idx[nifs].if_index = 0; - __if_freenameindex (idx); + if_freenameindex (idx); idx = NULL; goto nomem; } @@ -277,7 +283,8 @@ if_nameindex (void) return idx; } #endif -hidden_strong_alias(if_nameindex,__if_nameindex) +libc_hidden_proto(if_nameindex) +libc_hidden_def(if_nameindex) #if 0 struct if_nameindex * @@ -305,36 +312,36 @@ 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) { int serrno = errno; - __close (fd); + close (fd); if (serrno == ENODEV) /* POSIX requires ENXIO. */ serrno = ENXIO; __set_errno (serrno); return NULL; } - __close (fd); + close (fd); - return __strncpy (ifname, ifr.ifr_name, IFNAMSIZ); + return strncpy (ifname, ifr.ifr_name, IFNAMSIZ); # else struct if_nameindex *idx; struct if_nameindex *p; char *result = NULL; - idx = __if_nameindex(); + idx = if_nameindex(); if (idx != NULL) { for (p = idx; p->if_index || p->if_name; ++p) if (p->if_index == ifindex) { - result = __strncpy (ifname, p->if_name, IFNAMSIZ); + result = strncpy (ifname, p->if_name, IFNAMSIZ); break; } - __if_freenameindex (idx); + if_freenameindex (idx); if (result == NULL) __set_errno (ENXIO); diff --git a/libc/inet/ifaddrs.c b/libc/inet/ifaddrs.c index 74f3622f8..d2d0cb8ce 100644 --- a/libc/inet/ifaddrs.c +++ b/libc/inet/ifaddrs.c @@ -17,13 +17,6 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#define time __time -#define sendto __sendto -#define recvmsg __recvmsg -#define bind __bind -#define mempcpy __mempcpy -#define getsockname __getsockname - #define __FORCE_GLIBC #include #define __USE_GNU @@ -37,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -46,6 +40,17 @@ #include "netlinkaccess.h" +libc_hidden_proto(socket) +libc_hidden_proto(close) +libc_hidden_proto(time) +libc_hidden_proto(sendto) +libc_hidden_proto(recvmsg) +libc_hidden_proto(bind) +libc_hidden_proto(memset) +libc_hidden_proto(mempcpy) +libc_hidden_proto(getsockname) +libc_hidden_proto(fclose) +libc_hidden_proto(abort) #ifndef __libc_use_alloca # define __libc_use_alloca(x) (x < __MAX_ALLOCA_CUTOFF) @@ -116,7 +121,7 @@ __netlink_sendreq (struct netlink_handle *h, int type) memset (&nladdr, '\0', sizeof (nladdr)); nladdr.nl_family = AF_NETLINK; - return TEMP_FAILURE_RETRY (__sendto (h->fd, (void *) &req, sizeof (req), 0, + return TEMP_FAILURE_RETRY (sendto (h->fd, (void *) &req, sizeof (req), 0, (struct sockaddr *) &nladdr, sizeof (nladdr))); } @@ -167,7 +172,7 @@ __netlink_request (struct netlink_handle *h, int type) 0 }; - read_len = TEMP_FAILURE_RETRY (__recvmsg (h->fd, &msg, 0)); + read_len = TEMP_FAILURE_RETRY (recvmsg (h->fd, &msg, 0)); if (read_len < 0) goto out_fail; @@ -282,7 +287,7 @@ __netlink_close (struct netlink_handle *h) { /* Don't modify errno. */ int serrno = errno; - __close(h->fd); + close(h->fd); __set_errno(serrno); } @@ -293,13 +298,13 @@ __netlink_open (struct netlink_handle *h) { struct sockaddr_nl nladdr; - h->fd = __socket (PF_NETLINK, SOCK_RAW, NETLINK_ROUTE); + h->fd = socket (PF_NETLINK, SOCK_RAW, NETLINK_ROUTE); if (h->fd < 0) goto out; memset (&nladdr, '\0', sizeof (nladdr)); nladdr.nl_family = AF_NETLINK; - if (__bind (h->fd, (struct sockaddr *) &nladdr, sizeof (nladdr)) < 0) + if (bind (h->fd, (struct sockaddr *) &nladdr, sizeof (nladdr)) < 0) { close_and_out: __netlink_close (h); @@ -313,7 +318,7 @@ __netlink_open (struct netlink_handle *h) It is not necessarily the PID if there is more than one socket open. */ socklen_t addr_len = sizeof (nladdr); - if (__getsockname (h->fd, (struct sockaddr *) &nladdr, &addr_len) < 0) + if (getsockname (h->fd, (struct sockaddr *) &nladdr, &addr_len) < 0) goto close_and_out; h->pid = nladdr.nl_pid; return 0; diff --git a/libc/inet/in6_addr.c b/libc/inet/in6_addr.c index 006f6a48b..9e9edf41b 100644 --- a/libc/inet/in6_addr.c +++ b/libc/inet/in6_addr.c @@ -24,10 +24,12 @@ #ifdef __UCLIBC_HAS_IPV6__ const struct in6_addr in6addr_any = { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } }; -hidden_weak_alias (in6addr_any, __in6addr_any) +//libc_hidden_proto(in6addr_any) +//libc_hidden_def(in6addr_any) const struct in6_addr in6addr_loopback = { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } }; -hidden_weak_alias(in6addr_loopback, __in6addr_loopback) +libc_hidden_proto(in6addr_loopback) +libc_hidden_def(in6addr_loopback) #endif /* __UCLIBC_HAS_IPV6__ */ diff --git a/libc/inet/inet_net.c b/libc/inet/inet_net.c index a7d1844a7..29226c01a 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 attribute_hidden -__inet_network(const char *cp) +in_addr_t +inet_network(const char *cp) { register in_addr_t val, base, n; register char c; @@ -98,4 +98,5 @@ again: } return (val); } -strong_alias(__inet_network,inet_network) +libc_hidden_proto(inet_network) +libc_hidden_def(inet_network) diff --git a/libc/inet/ntop.c b/libc/inet/ntop.c index 6f3a8ccec..fd5feb10e 100644 --- a/libc/inet/ntop.c +++ b/libc/inet/ntop.c @@ -30,6 +30,11 @@ #include #include +libc_hidden_proto(memcpy) +libc_hidden_proto(memset) +libc_hidden_proto(strchr) +libc_hidden_proto(strcpy) +libc_hidden_proto(strlen) /* * WARNING: Don't even consider trying to compile this on a system where @@ -76,12 +81,12 @@ inet_ntop4(const u_char *src, char *dst, size_t size) } tmp[i - 1] = '\0'; - if (__strlen (tmp) > size) { + if (strlen (tmp) > size) { __set_errno (ENOSPC); return (NULL); } - return __strcpy(dst, tmp); + return strcpy(dst, tmp); } @@ -114,7 +119,7 @@ inet_ntop6(const u_char *src, char *dst, size_t size) * Copy the input (bytewise) array into a wordwise array. * Find the longest run of 0x00's in src[] for :: shorthanding. */ - __memset(words, '\0', sizeof words); + memset(words, '\0', sizeof words); for (i = 0; i < 16; i += 2) words[i / 2] = (src[i] << 8) | src[i + 1]; best.base = -1; @@ -160,7 +165,7 @@ inet_ntop6(const u_char *src, char *dst, size_t size) (best.len == 6 || (best.len == 5 && words[5] == 0xffff))) { if (!inet_ntop4(src+12, tp, sizeof tmp - (tp - tmp))) return (NULL); - tp += __strlen(tp); + tp += strlen(tp); break; } tp += __sprintf(tp, "%x", words[i]); @@ -177,7 +182,7 @@ inet_ntop6(const u_char *src, char *dst, size_t size) __set_errno (ENOSPC); return (NULL); } - return __strcpy(dst, tmp); + return strcpy(dst, tmp); } #endif /* __UCLIBC_HAS_IPV6__ */ @@ -224,7 +229,7 @@ inet_pton4(const char *src, u_char *dst) } if (octets < 4) return (0); - __memcpy(dst, tmp, 4); + memcpy(dst, tmp, 4); return (1); } @@ -261,7 +266,7 @@ inet_pton6(const char *src, u_char *dst) u_int val; - tp = __memset(tmp, '\0', 16); + tp = memset(tmp, '\0', 16); endp = tp + 16; colonp = NULL; /* Leading :: requires some special handling. */ @@ -274,7 +279,7 @@ inet_pton6(const char *src, u_char *dst) while ((ch = __tolower (*src++)) != '\0') { const char *pch; - pch = __strchr(xdigits, ch); + pch = strchr(xdigits, ch); if (pch != NULL) { val <<= 4; val |= (pch - xdigits); @@ -333,7 +338,7 @@ inet_pton6(const char *src, u_char *dst) } if (tp != endp) return (0); - __memcpy(dst, tmp, 16); + memcpy(dst, tmp, 16); return (1); } @@ -349,8 +354,8 @@ inet_pton6(const char *src, u_char *dst) * author: * Paul Vixie, 1996. */ -const char attribute_hidden * -__inet_ntop(int af, const void *src, char *dst, socklen_t size) +const char * +inet_ntop(int af, const void *src, char *dst, socklen_t size) { switch (af) { case AF_INET: @@ -365,7 +370,8 @@ __inet_ntop(int af, const void *src, char *dst, socklen_t size) } /* NOTREACHED */ } -strong_alias(__inet_ntop,inet_ntop) +libc_hidden_proto(inet_ntop) +libc_hidden_def(inet_ntop) /* int @@ -379,8 +385,8 @@ strong_alias(__inet_ntop,inet_ntop) * author: * Paul Vixie, 1996. */ -int attribute_hidden -__inet_pton(int af, const char *src, void *dst) +int +inet_pton(int af, const char *src, void *dst) { switch (af) { case AF_INET: @@ -395,4 +401,5 @@ __inet_pton(int af, const char *src, void *dst) } /* NOTREACHED */ } -strong_alias(__inet_pton,inet_pton) +libc_hidden_proto(inet_pton) +libc_hidden_def(inet_pton) diff --git a/libc/inet/opensock.c b/libc/inet/opensock.c index a27141a16..4db86bd7b 100644 --- a/libc/inet/opensock.c +++ b/libc/inet/opensock.c @@ -25,6 +25,8 @@ #include #include +libc_hidden_proto(socket) + /* Return a socket of any type. The socket can be used in subsequent ioctl calls to talk to the kernel. */ int attribute_hidden @@ -32,9 +34,9 @@ __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); } diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c index 6fedcf7e2..1e0392059 100644 --- a/libc/inet/resolv.c +++ b/libc/inet/resolv.c @@ -133,24 +133,6 @@ * */ -#define strnlen __strnlen -#define strncat __strncat -#define strstr __strstr -#define random __random -#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 select __select -#define recv __recv -#define send __send -#define snprintf __snprintf -#define fgets __fgets - #define __FORCE_GLIBC #include #include @@ -171,14 +153,53 @@ #include #include -extern int __gethostbyname_r (__const char *__restrict __name, - struct hostent *__restrict __result_buf, - char *__restrict __buf, size_t __buflen, - struct hostent **__restrict __result, - int *__restrict __h_errnop) attribute_hidden; +libc_hidden_proto(memcpy) +libc_hidden_proto(memset) +libc_hidden_proto(memmove) +libc_hidden_proto(strchr) +libc_hidden_proto(strcmp) +libc_hidden_proto(strcpy) +libc_hidden_proto(strdup) +libc_hidden_proto(strlen) +libc_hidden_proto(strncat) +libc_hidden_proto(strncpy) +/* libc_hidden_proto(strnlen) */ +libc_hidden_proto(strstr) +libc_hidden_proto(strcasecmp) +libc_hidden_proto(socket) +libc_hidden_proto(close) +libc_hidden_proto(fopen) +libc_hidden_proto(fclose) +libc_hidden_proto(random) +libc_hidden_proto(getservbyport) +libc_hidden_proto(getdomainname) +libc_hidden_proto(uname) +libc_hidden_proto(inet_addr) +libc_hidden_proto(inet_aton) +libc_hidden_proto(inet_pton) +libc_hidden_proto(inet_ntop) +libc_hidden_proto(connect) +libc_hidden_proto(select) +libc_hidden_proto(recv) +libc_hidden_proto(send) +libc_hidden_proto(printf) +libc_hidden_proto(sprintf) +libc_hidden_proto(snprintf) +libc_hidden_proto(fgets) +libc_hidden_proto(gethostbyname) +libc_hidden_proto(gethostbyname_r) +libc_hidden_proto(gethostbyname2_r) +libc_hidden_proto(gethostbyaddr) +libc_hidden_proto(gethostbyaddr_r) +libc_hidden_proto(ns_name_uncompress) +libc_hidden_proto(ns_name_unpack) +libc_hidden_proto(ns_name_ntop) +libc_hidden_proto(res_init) +libc_hidden_proto(res_query) +libc_hidden_proto(res_querydomain) +libc_hidden_proto(gethostent_r) +libc_hidden_proto(fprintf) -extern struct hostent *__gethostbyaddr (__const void *__addr, __socklen_t __len, - int __type) attribute_hidden; #define MAX_RECURSE 5 #define REPLY_TIMEOUT 10 #define MAX_RETRIES 3 @@ -281,7 +302,7 @@ extern int __decode_header(unsigned char * data, struct resolv_header * h) attri extern int __encode_question(struct resolv_question * q, unsigned char * dest, int maxlen) attribute_hidden; extern int __decode_question(unsigned char * message, int offset, - struct resolv_question * q); + struct resolv_question * q) attribute_hidden; extern int __encode_answer(struct resolv_answer * a, unsigned char * dest, int maxlen) attribute_hidden; extern int __decode_answer(unsigned char * message, int offset, @@ -291,17 +312,6 @@ extern int __open_nameservers(void) attribute_hidden; extern void __close_nameservers(void) attribute_hidden; extern int __dn_expand(const u_char *, const u_char *, const u_char *, char *, int); -extern int __ns_name_uncompress_internal(const u_char *, const u_char *, - const u_char *, char *, size_t) attribute_hidden; -extern int __ns_name_ntop_internal(const u_char *, char *, size_t) attribute_hidden; -extern int __ns_name_unpack_internal(const u_char *, const u_char *, const u_char *, - u_char *, size_t) attribute_hidden; - - -extern int __gethostent_r (struct hostent *__restrict __result_buf, - char *__restrict __buf, size_t __buflen, - struct hostent **__restrict __result, - int *__restrict __h_errnop) attribute_hidden; #ifdef L_encodeh int attribute_hidden __encode_header(struct resolv_header *h, unsigned char *dest, int maxlen) @@ -360,14 +370,14 @@ int attribute_hidden __encode_dotted(const char *dotted, unsigned char *dest, in int used = 0; while (dotted && *dotted) { - char *c = __strchr(dotted, '.'); - int l = c ? c - dotted : __strlen(dotted); + char *c = strchr(dotted, '.'); + int l = c ? c - dotted : strlen(dotted); if (l >= (maxlen - used - 1)) return -1; dest[used++] = l; - __memcpy(dest + used, dotted, l); + memcpy(dest + used, dotted, l); used += l; if (c) @@ -415,7 +425,7 @@ int attribute_hidden __decode_dotted(const unsigned char *data, int offset, if ((used + l + 1) >= maxlen) return -1; - __memcpy(dest + used, data + offset, l); + memcpy(dest + used, data + offset, l); offset += l; used += l; if (measure) @@ -439,7 +449,6 @@ int attribute_hidden __decode_dotted(const unsigned char *data, int offset, #endif #ifdef L_lengthd - int attribute_hidden __length_dotted(const unsigned char *data, int offset) { int orig_offset = offset; @@ -488,7 +497,7 @@ int attribute_hidden __encode_question(struct resolv_question *q, #endif #ifdef L_decodeq -int __decode_question(unsigned char *message, int offset, +int attribute_hidden __decode_question(unsigned char *message, int offset, struct resolv_question *q) { char temp[256]; @@ -500,7 +509,7 @@ int __decode_question(unsigned char *message, int offset, offset += i; - q->dotted = __strdup(temp); + q->dotted = strdup(temp); q->qtype = (message[offset + 0] << 8) | message[offset + 1]; q->qclass = (message[offset + 2] << 8) | message[offset + 3]; @@ -546,7 +555,7 @@ int attribute_hidden __encode_answer(struct resolv_answer *a, unsigned char *des *dest++ = (a->ttl & 0x000000ff) >> 0; *dest++ = (a->rdlength & 0xff00) >> 8; *dest++ = (a->rdlength & 0x00ff) >> 0; - __memcpy(dest, a->rdata, a->rdlength); + memcpy(dest, a->rdata, a->rdlength); return i + RRFIXEDSZ + a->rdlength; } @@ -565,7 +574,7 @@ int attribute_hidden __decode_answer(unsigned char *message, int offset, message += offset + i; - a->dotted = __strdup(temp); + a->dotted = strdup(temp); a->atype = (message[0] << 8) | message[1]; message += 2; a->aclass = (message[0] << 8) | message[1]; @@ -585,7 +594,7 @@ int attribute_hidden __decode_answer(unsigned char *message, int offset, #endif #ifdef L_encodep -int __encode_packet(struct resolv_header *h, +int attribute_hidden __encode_packet(struct resolv_header *h, struct resolv_question **q, struct resolv_answer **an, struct resolv_answer **ns, @@ -642,7 +651,7 @@ int __encode_packet(struct resolv_header *h, #endif #ifdef L_decodep -int __decode_packet(unsigned char *data, struct resolv_header *h) +int attribute_hidden __decode_packet(unsigned char *data, struct resolv_header *h) { return __decode_header(data, h); } @@ -656,7 +665,7 @@ int __form_query(int id, const char *name, int type, unsigned char *packet, struct resolv_question q; int i, j; - __memset(&h, 0, sizeof(h)); + memset(&h, 0, sizeof(h)); h.id = id; h.qdcount = 1; @@ -729,11 +738,11 @@ int attribute_hidden __dns_lookup(const char *name, int type, int nscount, char while (retries < MAX_RETRIES) { if (fd != -1) - __close(fd); + close(fd); - __memset(packet, 0, PACKETSZ); + memset(packet, 0, PACKETSZ); - __memset(&h, 0, sizeof(h)); + memset(&h, 0, sizeof(h)); ++local_id; local_id &= 0xffff; @@ -749,7 +758,7 @@ int attribute_hidden __dns_lookup(const char *name, int type, int nscount, char if (i < 0) goto fail; - __strncpy(lookup,name,MAXDNAME); + strncpy(lookup,name,MAXDNAME); if (variant >= 0) { BIGLOCK; if (variant < __searchdomains) { @@ -774,9 +783,9 @@ int attribute_hidden __dns_lookup(const char *name, int type, int nscount, char #ifdef __UCLIBC_HAS_IPV6__ v6 = inet_pton(AF_INET6, dns, &sa6.sin6_addr) > 0; - fd = __socket(v6 ? AF_INET6 : AF_INET, SOCK_DGRAM, IPPROTO_UDP); + fd = socket(v6 ? AF_INET6 : AF_INET, SOCK_DGRAM, IPPROTO_UDP); #else - fd = __socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); + fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); #endif if (fd < 0) { retries++; @@ -880,7 +889,7 @@ int attribute_hidden __dns_lookup(const char *name, int type, int nscount, char ma.buf = a->buf; ma.buflen = a->buflen; ma.add_count = a->add_count; - __memcpy(a, &ma, sizeof(ma)); + memcpy(a, &ma, sizeof(ma)); if (a->atype != T_SIG && (0 == a->buf || (type != T_A && type != T_AAAA))) { break; @@ -912,7 +921,7 @@ int attribute_hidden __dns_lookup(const char *name, int type, int nscount, char ma.rdlength, a->rdlength); goto again; } - __memcpy(a->buf + (a->add_count * ma.rdlength), ma.rdata, ma.rdlength); + memcpy(a->buf + (a->add_count * ma.rdlength), ma.rdata, ma.rdlength); ++a->add_count; } } @@ -920,7 +929,7 @@ int attribute_hidden __dns_lookup(const char *name, int type, int nscount, char DPRINTF("Answer name = |%s|\n", a->dotted); DPRINTF("Answer type = |%d|\n", a->atype); - __close(fd); + close(fd); if (outpacket) *outpacket = packet; @@ -972,7 +981,7 @@ int attribute_hidden __dns_lookup(const char *name, int type, int nscount, char fail: if (fd != -1) - __close(fd); + close(fd); if (lookup) free(lookup); if (packet) @@ -1038,21 +1047,21 @@ int attribute_hidden __open_nameservers() *p++ = '\0'; } - if (__strcmp(argv[0], "nameserver") == 0) { + if (strcmp(argv[0], "nameserver") == 0) { for (i = 1; i < argc && __nameservers < MAX_SERVERS; i++) { - __nameserver[__nameservers++] = __strdup(argv[i]); + __nameserver[__nameservers++] = strdup(argv[i]); DPRINTF("adding nameserver %s\n", argv[i]); } } /* domain and search are mutually exclusive, the last one wins */ - if (__strcmp(argv[0],"domain")==0 || __strcmp(argv[0],"search")==0) { + if (strcmp(argv[0],"domain")==0 || strcmp(argv[0],"search")==0) { while (__searchdomains > 0) { free(__searchdomain[--__searchdomains]); __searchdomain[__searchdomains] = NULL; } for (i=1; i < argc && __searchdomains < MAX_SEARCH; i++) { - __searchdomain[__searchdomains++] = __strdup(argv[i]); + __searchdomain[__searchdomains++] = strdup(argv[i]); DPRINTF("adding search %s\n", argv[i]); } } @@ -1089,7 +1098,7 @@ void attribute_hidden __close_nameservers(void) #ifdef L_gethostbyname -struct hostent attribute_hidden *__gethostbyname(const char *name) +struct hostent *gethostbyname(const char *name) { static struct hostent h; static char buf[sizeof(struct in_addr) + @@ -1097,29 +1106,19 @@ struct hostent attribute_hidden *__gethostbyname(const char *name) sizeof(char *)*(ALIAS_DIM) + 384/*namebuffer*/ + 32/* margin */]; struct hostent *hp; - __gethostbyname_r(name, &h, buf, sizeof(buf), &hp, &h_errno); + gethostbyname_r(name, &h, buf, sizeof(buf), &hp, &h_errno); return hp; } -strong_alias(__gethostbyname,gethostbyname) +libc_hidden_def(gethostbyname) #endif #ifdef L_gethostbyname2 -#ifndef __UCLIBC_HAS_IPV6__ -extern struct hostent *__gethostbyname (__const char *__name) attribute_hidden; -#else -extern int __gethostbyname2_r (__const char *__restrict __name, int __af, - struct hostent *__restrict __result_buf, - char *__restrict __buf, size_t __buflen, - struct hostent **__restrict __result, - int *__restrict __h_errnop) attribute_hidden; -#endif - struct hostent *gethostbyname2(const char *name, int family) { #ifndef __UCLIBC_HAS_IPV6__ - return family == AF_INET ? __gethostbyname(name) : (struct hostent*)0; + return family == AF_INET ? gethostbyname(name) : (struct hostent*)0; #else /* __UCLIBC_HAS_IPV6__ */ static struct hostent h; static char buf[sizeof(struct in6_addr) + @@ -1127,7 +1126,7 @@ struct hostent *gethostbyname2(const char *name, int family) sizeof(char *)*(ALIAS_DIM) + 384/*namebuffer*/ + 32/* margin */]; struct hostent *hp; - __gethostbyname2_r(name, family, &h, buf, sizeof(buf), &hp, &h_errno); + gethostbyname2_r(name, family, &h, buf, sizeof(buf), &hp, &h_errno); return hp; #endif /* __UCLIBC_HAS_IPV6__ */ @@ -1139,7 +1138,7 @@ struct hostent *gethostbyname2(const char *name, int family) #ifdef L_res_init struct __res_state _res; -int attribute_hidden __res_init_internal(void) +int res_init(void) { struct __res_state *rp = &(_res); @@ -1184,7 +1183,7 @@ int attribute_hidden __res_init_internal(void) return(0); } -strong_alias(__res_init_internal,res_init) +libc_hidden_def(res_init) void res_close( void ) { @@ -1200,11 +1199,7 @@ void res_close( void ) #define MIN(x, y) ((x) < (y) ? (x) : (y)) #endif -int __res_init_internal (void) __THROW attribute_hidden; -int __res_querydomain_internal (const char *, const char *, int, int, - u_char *, int) __THROW attribute_hidden; - -int attribute_hidden __res_query_internal(const char *dname, int class, int type, +int res_query(const char *dname, int class, int type, unsigned char *answer, int anslen) { int i; @@ -1219,7 +1214,7 @@ int attribute_hidden __res_query_internal(const char *dname, int class, int type return(-1); } - __memset((char *) &a, '\0', sizeof(a)); + memset((char *) &a, '\0', sizeof(a)); BIGLOCK; __nameserversXX=__nameservers; @@ -1236,7 +1231,7 @@ int attribute_hidden __res_query_internal(const char *dname, int class, int type if (a.atype == type) { /* CNAME*/ int len = MIN(anslen, i); - __memcpy(answer, packet, len); + memcpy(answer, packet, len); if (packet) free(packet); return(len); @@ -1245,7 +1240,7 @@ int attribute_hidden __res_query_internal(const char *dname, int class, int type free(packet); return i; } -strong_alias(__res_query_internal,res_query) +libc_hidden_def(res_query) /* * Formulate a normal query, send, and retrieve answer in supplied buffer. @@ -1265,7 +1260,7 @@ int res_search(name, class, type, answer, anslen) int trailing_dot, ret, saved_herrno; int got_nodata = 0, got_servfail = 0, tried_as_is = 0; - if ((!name || !answer) || ((_res.options & RES_INIT) == 0 && __res_init_internal() == -1)) { + if ((!name || !answer) || ((_res.options & RES_INIT) == 0 && res_init() == -1)) { h_errno = NETDB_INTERNAL; return (-1); } @@ -1285,7 +1280,7 @@ int res_search(name, class, type, answer, anslen) */ saved_herrno = -1; if (dots >= _res.ndots) { - ret = __res_querydomain_internal(name, NULL, class, type, answer, anslen); + ret = res_querydomain(name, NULL, class, type, answer, anslen); if (ret > 0) return (ret); saved_herrno = h_errno; @@ -1306,7 +1301,7 @@ int res_search(name, class, type, answer, anslen) *domain && !done; domain++) { - ret = __res_querydomain_internal(name, *domain, class, type, + ret = res_querydomain(name, *domain, class, type, answer, anslen); if (ret > 0) return (ret); @@ -1362,7 +1357,7 @@ int res_search(name, class, type, answer, anslen) * name or whether it ends with a dot. */ if (!tried_as_is) { - ret = __res_querydomain_internal(name, NULL, class, type, answer, anslen); + ret = res_querydomain(name, NULL, class, type, answer, anslen); if (ret > 0) return (ret); } @@ -1388,7 +1383,7 @@ int res_search(name, class, type, answer, anslen) * Perform a call on res_query on the concatenation of name and domain, * removing a trailing dot from name if domain is NULL. */ -int attribute_hidden __res_querydomain_internal(name, domain, class, type, answer, anslen) +int res_querydomain(name, domain, class, type, answer, anslen) const char *name, *domain; int class, type; /* class and type of query */ u_char *answer; /* buffer to put answer */ @@ -1398,14 +1393,14 @@ int attribute_hidden __res_querydomain_internal(name, domain, class, type, answe const char *longname = nbuf; size_t n, d; - if ((!name || !answer) || ((_res.options & RES_INIT) == 0 && __res_init_internal() == -1)) { + if ((!name || !answer) || ((_res.options & RES_INIT) == 0 && res_init() == -1)) { h_errno = NETDB_INTERNAL; return (-1); } #ifdef DEBUG if (_res.options & RES_DEBUG) - __printf(";; res_querydomain(%s, %s, %d, %d)\n", + printf(";; res_querydomain(%s, %s, %d, %d)\n", name, domain?domain:"", class, type); #endif if (domain == NULL) { @@ -1413,28 +1408,28 @@ int attribute_hidden __res_querydomain_internal(name, domain, class, type, answe * Check for trailing '.'; * copy without '.' if present. */ - n = __strlen(name); + n = strlen(name); if (n + 1 > sizeof(nbuf)) { h_errno = NO_RECOVERY; return (-1); } if (n > 0 && name[--n] == '.') { - __strncpy(nbuf, name, n); + strncpy(nbuf, name, n); nbuf[n] = '\0'; } else longname = name; } else { - n = __strlen(name); - d = __strlen(domain); + n = strlen(name); + d = strlen(domain); if (n + 1 + d + 1 > sizeof(nbuf)) { h_errno = NO_RECOVERY; return (-1); } snprintf(nbuf, sizeof(nbuf), "%s.%s", name, domain); } - return (__res_query_internal(longname, class, type, answer, anslen)); + return (res_query(longname, class, type, answer, anslen)); } -strong_alias(__res_querydomain_internal,res_querydomain) +libc_hidden_def(res_querydomain) /* res_mkquery */ /* res_send */ @@ -1443,14 +1438,7 @@ strong_alias(__res_querydomain_internal,res_querydomain) #endif #ifdef L_gethostbyaddr -extern int __gethostbyaddr_r (__const void *__restrict __addr, __socklen_t __len, - int __type, - struct hostent *__restrict __result_buf, - char *__restrict __buf, size_t __buflen, - struct hostent **__restrict __result, - int *__restrict __h_errnop) attribute_hidden; - -struct hostent attribute_hidden *__gethostbyaddr (const void *addr, socklen_t len, int type) +struct hostent *gethostbyaddr (const void *addr, socklen_t len, int type) { static struct hostent h; static char buf[ @@ -1462,11 +1450,11 @@ struct hostent attribute_hidden *__gethostbyaddr (const void *addr, socklen_t le sizeof(char *)*(ALIAS_DIM) + 384/*namebuffer*/ + 32/* margin */]; struct hostent *hp; - __gethostbyaddr_r(addr, len, type, &h, buf, sizeof(buf), &hp, &h_errno); + gethostbyaddr_r(addr, len, type, &h, buf, sizeof(buf), &hp, &h_errno); return hp; } -strong_alias(__gethostbyaddr,gethostbyaddr) +libc_hidden_def(gethostbyaddr) #endif @@ -1551,7 +1539,7 @@ int attribute_hidden __read_etc_hosts_r(FILE * fp, const char * name, int type, *h_errnop=HOST_NOT_FOUND; while (fgets(buf, buflen, fp)) { - if ((cp = __strchr(buf, '#'))) + if ((cp = strchr(buf, '#'))) *cp = '\0'; DPRINTF("Looking at: %s\n", buf); aliases = 0; @@ -1576,12 +1564,12 @@ int attribute_hidden __read_etc_hosts_r(FILE * fp, const char * name, int type, /* Return whatever the next entry happens to be. */ break; } else if (action==GET_HOSTS_BYADDR) { - if (__strcmp(name, alias[0]) != 0) + if (strcmp(name, alias[0]) != 0) continue; } else { /* GET_HOSTS_BYNAME */ for (i = 1; i < aliases; i++) - if (__strcasecmp(name, alias[i]) == 0) + if (strcasecmp(name, alias[i]) == 0) break; if (i >= aliases) continue; @@ -1652,7 +1640,7 @@ void sethostent (int stay_open) UNLOCK; } -int attribute_hidden __gethostent_r(struct hostent *result_buf, char *buf, size_t buflen, +int gethostent_r(struct hostent *result_buf, char *buf, size_t buflen, struct hostent **result, int *h_errnop) { int ret; @@ -1675,7 +1663,7 @@ int attribute_hidden __gethostent_r(struct hostent *result_buf, char *buf, size_ UNLOCK; return(ret); } -strong_alias(__gethostent_r,gethostent_r) +libc_hidden_def(gethostent_r) struct hostent *gethostent (void) { @@ -1691,7 +1679,7 @@ st