summaryrefslogtreecommitdiff
path: root/libc/inet
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2005-12-07 16:09:49 +0000
committerPeter S. Mazinger <ps.m@gmx.net>2005-12-07 16:09:49 +0000
commit53b5f21c9c453ff74c9aabdecd166a5e6ddb202b (patch)
tree7e94f2193471512a521b3675b28a27b829a43707 /libc/inet
parent746d0019f275acc0d3752b54e8ae1930a2f5fa3c (diff)
Hide more
Diffstat (limited to 'libc/inet')
-rw-r--r--libc/inet/getaddrinfo.c9
-rw-r--r--libc/inet/getproto.c33
-rw-r--r--libc/inet/hostid.c2
-rw-r--r--libc/inet/resolv.c61
-rw-r--r--libc/inet/rpc/auth_unix.c2
-rw-r--r--libc/inet/rpc/clnt_generic.c2
-rw-r--r--libc/inet/rpc/clnt_raw.c1
-rw-r--r--libc/inet/rpc/clnt_simple.c1
-rw-r--r--libc/inet/rpc/clnt_tcp.c1
-rw-r--r--libc/inet/rpc/clnt_udp.c2
-rw-r--r--libc/inet/rpc/clnt_unix.c1
-rw-r--r--libc/inet/rpc/getrpcport.c1
-rw-r--r--libc/inet/rpc/rcmd.c4
-rw-r--r--libc/inet/rpc/rexec.c4
-rw-r--r--libc/inet/rpc/rpc_prot.c5
-rw-r--r--libc/inet/rpc/ruserpass.c1
-rw-r--r--libc/inet/rpc/svc_tcp.c1
-rw-r--r--libc/inet/rpc/svc_udp.c1
-rw-r--r--libc/inet/rpc/svc_unix.c1
-rw-r--r--libc/inet/socketcalls.c7
20 files changed, 105 insertions, 35 deletions
diff --git a/libc/inet/getaddrinfo.c b/libc/inet/getaddrinfo.c
index c467fed69..e896e3449 100644
--- a/libc/inet/getaddrinfo.c
+++ b/libc/inet/getaddrinfo.c
@@ -45,7 +45,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/* 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
#if 0
+#define uname __uname
#define stpcpy __stpcpy
/* strdupa is using these */
#define memcpy __memcpy
@@ -767,8 +771,8 @@ static struct gaih gaih[] =
{ PF_UNSPEC, NULL }
};
-int
-getaddrinfo (const char *name, const char *service,
+int attribute_hidden
+__getaddrinfo (const char *name, const char *service,
const struct addrinfo *hints, struct addrinfo **pai)
{
int i = 0, j = 0, last_i = 0;
@@ -866,6 +870,7 @@ getaddrinfo (const char *name, const char *service,
return last_i ? -(last_i & GAIH_EAI) : EAI_NONAME;
}
+strong_alias(__getaddrinfo,getaddrinfo)
void
freeaddrinfo (struct addrinfo *ai)
diff --git a/libc/inet/getproto.c b/libc/inet/getproto.c
index a5ebcb3e9..adb83a5ca 100644
--- a/libc/inet/getproto.c
+++ b/libc/inet/getproto.c
@@ -91,7 +91,7 @@ static void __initbuf(void)
}
}
-void setprotoent(int f)
+void attribute_hidden __setprotoent(int f)
{
LOCK;
if (protof == NULL)
@@ -101,8 +101,9 @@ void setprotoent(int f)
proto_stayopen |= f;
UNLOCK;
}
+strong_alias(__setprotoent,setprotoent)
-void endprotoent(void)
+void attribute_hidden __endprotoent(void)
{
LOCK;
if (protof) {
@@ -112,8 +113,9 @@ void endprotoent(void)
proto_stayopen = 0;
UNLOCK;
}
+strong_alias(__endprotoent,endprotoent)
-int getprotoent_r(struct protoent *result_buf,
+int attribute_hidden __getprotoent_r(struct protoent *result_buf,
char *buf, size_t buflen,
struct protoent **result)
{
@@ -189,18 +191,19 @@ again:
UNLOCK;
return 0;
}
+strong_alias(__getprotoent_r,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 getprotobyname_r(const char *name,
+int attribute_hidden __getprotobyname_r(const char *name,
struct protoent *result_buf,
char *buf, size_t buflen,
struct protoent **result)
@@ -209,8 +212,8 @@ int getprotobyname_r(const char *name,
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 (__strcmp(result_buf->p_name, name) == 0)
break;
for (cp = result_buf->p_aliases; *cp != 0; cp++)
@@ -219,10 +222,11 @@ int getprotobyname_r(const char *name,
}
found:
if (!proto_stayopen)
- endprotoent();
+ __endprotoent();
UNLOCK;
return *result?0:ret;
}
+strong_alias(__getprotobyname_r,getprotobyname_r)
struct protoent * getprotobyname(const char *name)
@@ -230,12 +234,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 getprotobynumber_r (int proto_num,
+int attribute_hidden __getprotobynumber_r (int proto_num,
struct protoent *result_buf,
char *buf, size_t buflen,
struct protoent **result)
@@ -243,22 +247,23 @@ int 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)
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/hostid.c b/libc/inet/hostid.c
index 1a3e05113..bc9576e74 100644
--- a/libc/inet/hostid.c
+++ b/libc/inet/hostid.c
@@ -1,5 +1,7 @@
#define geteuid __geteuid
#define getuid __getuid
+#define gethostbyname __gethostbyname
+#define gethostname __gethostname
#define __FORCE_GLIBC
#include <features.h>
diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c
index d2f90a270..af38c14a5 100644
--- a/libc/inet/resolv.c
+++ b/libc/inet/resolv.c
@@ -138,6 +138,8 @@
#define strstr __strstr
#define random __random
#define getservbyport __getservbyport
+#define getdomainname __getdomainname
+#define uname __uname
#define __FORCE_GLIBC
#include <features.h>
@@ -159,6 +161,14 @@
#include <sys/utsname.h>
#include <sys/un.h>
+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;
+
+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
@@ -1069,7 +1079,7 @@ void attribute_hidden __close_nameservers(void)
#ifdef L_gethostbyname
-struct hostent *gethostbyname(const char *name)
+struct hostent attribute_hidden *__gethostbyname(const char *name)
{
static struct hostent h;
static char buf[sizeof(struct in_addr) +
@@ -1077,18 +1087,29 @@ struct hostent *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)
#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) +
@@ -1096,7 +1117,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__ */
@@ -1405,7 +1426,14 @@ int res_querydomain(name, domain, class, type, answer, anslen)
#endif
#ifdef L_gethostbyaddr
-struct hostent *gethostbyaddr (const void *addr, socklen_t len, int type)
+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)
{
static struct hostent h;
static char buf[
@@ -1417,10 +1445,11 @@ struct hostent *gethostbyaddr (const void *addr, socklen_t len, int type)
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)
#endif
@@ -1706,7 +1735,7 @@ int attribute_hidden __get_hosts_byaddr_r(const char * addr, int len, int type,
# define min(x,y) (((x) > (y)) ? (y) : (x))
#endif /* min */
-int getnameinfo (const struct sockaddr *sa, socklen_t addrlen, char *host,
+int attribute_hidden __getnameinfo (const struct sockaddr *sa, socklen_t addrlen, char *host,
socklen_t hostlen, char *serv, socklen_t servlen,
unsigned int flags)
{
@@ -1747,12 +1776,12 @@ int getnameinfo (const struct sockaddr *sa, socklen_t addrlen, char *host,
if (!(flags & NI_NUMERICHOST)) {
#ifdef __UCLIBC_HAS_IPV6__
if (sa->sa_family == AF_INET6)
- h = gethostbyaddr ((const void *)
+ h = __gethostbyaddr ((const void *)
&(((const struct sockaddr_in6 *) sa)->sin6_addr),
sizeof(struct in6_addr), AF_INET6);
else
#endif /* __UCLIBC_HAS_IPV6__ */
- h = gethostbyaddr ((const void *) &(((const struct sockaddr_in *)sa)->sin_addr),
+ h = __gethostbyaddr ((const void *) &(((const struct sockaddr_in *)sa)->sin_addr),
sizeof(struct in_addr), AF_INET);
if (h) {
@@ -1892,12 +1921,13 @@ int getnameinfo (const struct sockaddr *sa, socklen_t addrlen, char *host,
errno = serrno;
return 0;
}
+strong_alias(__getnameinfo,getnameinfo)
#endif
#ifdef L_gethostbyname_r
-int gethostbyname_r(const char * name,
+int attribute_hidden __gethostbyname_r(const char * name,
struct hostent * result_buf,
char * buf, size_t buflen,
struct hostent ** result,
@@ -2046,18 +2076,19 @@ int gethostbyname_r(const char * name,
*h_errnop = NETDB_SUCCESS;
return NETDB_SUCCESS;
}
+strong_alias(__gethostbyname_r,gethostbyname_r)
#endif
#ifdef L_gethostbyname2_r
-int gethostbyname2_r(const char *name, int family,
+int attribute_hidden __gethostbyname2_r(const char *name, int family,
struct hostent * result_buf,
char * buf, size_t buflen,
struct hostent ** result,
int * h_errnop)
{
#ifndef __UCLIBC_HAS_IPV6__
- return family == (AF_INET)? gethostbyname_r(name, result_buf,
+ return family == (AF_INET)? __gethostbyname_r(name, result_buf,
buf, buflen, result, h_errnop) : HOST_NOT_FOUND;
#else /* __UCLIBC_HAS_IPV6__ */
struct in6_addr *in;
@@ -2070,7 +2101,7 @@ int gethostbyname2_r(const char *name, int family,
char ** __nameserverXX;
if (family == AF_INET)
- return gethostbyname_r(name, result_buf, buf, buflen, result, h_errnop);
+ return __gethostbyname_r(name, result_buf, buf, buflen, result, h_errnop);
if (family != AF_INET6)
return EINVAL;
@@ -2188,10 +2219,11 @@ int gethostbyname2_r(const char *name, int family,
return NETDB_SUCCESS;
#endif /* __UCLIBC_HAS_IPV6__ */
}
+strong_alias(__gethostbyname2_r,gethostbyname2_r)
#endif
#ifdef L_gethostbyaddr_r
-int gethostbyaddr_r (const void *addr, socklen_t len, int type,
+int attribute_hidden __gethostbyaddr_r (const void *addr, socklen_t len, int type,
struct hostent * result_buf,
char * buf, size_t buflen,
struct hostent ** result,
@@ -2372,6 +2404,7 @@ int gethostbyaddr_r (const void *addr, socklen_t len, int type,
*h_errnop = NETDB_SUCCESS;
return NETDB_SUCCESS;
}
+strong_alias(__gethostbyaddr_r,gethostbyaddr_r)
#endif
#ifdef L_res_comp
diff --git a/libc/inet/rpc/auth_unix.c b/libc/inet/rpc/auth_unix.c
index 95733163c..87852f36e 100644
--- a/libc/inet/rpc/auth_unix.c
+++ b/libc/inet/rpc/auth_unix.c
@@ -41,6 +41,8 @@
#define sysconf __sysconf
#define getegid __getegid
#define geteuid __geteuid
+#define getgroups __getgroups
+#define gethostname __gethostname
#define xdrmem_create __xdrmem_create
#define xdr_authunix_parms __xdr_authunix_parms
#define xdr_opaque_auth __xdr_opaque_auth
diff --git a/libc/inet/rpc/clnt_generic.c b/libc/inet/rpc/clnt_generic.c
index 1b30d2e1c..518ca0fa8 100644
--- a/libc/inet/rpc/clnt_generic.c
+++ b/libc/inet/rpc/clnt_generic.c
@@ -33,6 +33,8 @@
#define clnttcp_create __clnttcp_create
#define clntudp_create __clntudp_create
#define clntunix_create __clntunix_create
+#define getprotobyname_r __getprotobyname_r
+#define gethostbyname_r __gethostbyname_r
#define __FORCE_GLIBC
#include <features.h>
diff --git a/libc/inet/rpc/clnt_raw.c b/libc/inet/rpc/clnt_raw.c
index ff48523a9..aa7b44bb4 100644
--- a/libc/inet/rpc/clnt_raw.c
+++ b/libc/inet/rpc/clnt_raw.c
@@ -48,6 +48,7 @@ static char sccsid[] = "@(#)clnt_raw.c 1.22 87/08/11 Copyr 1984 Sun Micro";
#define xdr_replymsg __xdr_replymsg
#define xdr_opaque_auth __xdr_opaque_auth
#define svc_getreq __svc_getreq
+#define _seterr_reply __seterr_reply
#define __FORCE_GLIBC
#include <features.h>
diff --git a/libc/inet/rpc/clnt_simple.c b/libc/inet/rpc/clnt_simple.c
index 9105fc266..7c17dc1f1 100644
--- a/libc/inet/rpc/clnt_simple.c
+++ b/libc/inet/rpc/clnt_simple.c
@@ -39,6 +39,7 @@ static char sccsid[] = "@(#)clnt_simple.c 1.35 87/08/11 Copyr 1984 Sun Micro";
*/
#define clntudp_create __clntudp_create
+#define gethostbyname_r __gethostbyname_r
#define __FORCE_GLIBC
#include <features.h>
diff --git a/libc/inet/rpc/clnt_tcp.c b/libc/inet/rpc/clnt_tcp.c
index 4221eff63..f006c3383 100644
--- a/libc/inet/rpc/clnt_tcp.c
+++ b/libc/inet/rpc/clnt_tcp.c
@@ -59,6 +59,7 @@ static char sccsid[] = "@(#)clnt_tcp.c 1.37 87/10/05 Copyr 1984 Sun Micro";
#define xdr_opaque_auth __xdr_opaque_auth
#define xdrmem_create __xdrmem_create
#define pmap_getport __pmap_getport
+#define _seterr_reply __seterr_reply
#define __FORCE_GLIBC
#include <features.h>
diff --git a/libc/inet/rpc/clnt_udp.c b/libc/inet/rpc/clnt_udp.c
index b3d26fc21..c59a119b9 100644
--- a/libc/inet/rpc/clnt_udp.c
+++ b/libc/inet/rpc/clnt_udp.c
@@ -45,8 +45,8 @@ static char sccsid[] = "@(#)clnt_udp.c 1.39 87/08/11 Copyr 1984 Sun Micro";
#define xdr_callhdr __xdr_callhdr
#define xdr_replymsg __xdr_replymsg
#define xdr_opaque_auth __xdr_opaque_auth
-
#define pmap_getport __pmap_getport
+#define _seterr_reply __seterr_reply
#define __FORCE_GLIBC
#include <features.h>
diff --git a/libc/inet/rpc/clnt_unix.c b/libc/inet/rpc/clnt_unix.c
index 18b20af16..efdd39005 100644
--- a/libc/inet/rpc/clnt_unix.c
+++ b/libc/inet/rpc/clnt_unix.c
@@ -56,6 +56,7 @@
#define xdrmem_create __xdrmem_create
#define getegid __getegid
#define geteuid __geteuid
+#define _seterr_reply __seterr_reply
#define __FORCE_GLIBC
#include <features.h>
diff --git a/libc/inet/rpc/getrpcport.c b/libc/inet/rpc/getrpcport.c
index 518d190f8..48e58d9ab 100644
--- a/libc/inet/rpc/getrpcport.c
+++ b/libc/inet/rpc/getrpcport.c
@@ -36,6 +36,7 @@ static char sccsid[] = "@(#)getrpcport.c 1.3 87/08/11 SMI";
*/
#define pmap_getport __pmap_getport
+#define gethostbyname_r __gethostbyname_r
#define __FORCE_GLIBC
#include <features.h>
diff --git a/libc/inet/rpc/rcmd.c b/libc/inet/rpc/rcmd.c
index bd95a7e0c..bbcc7b354 100644
--- a/libc/inet/rpc/rcmd.c
+++ b/libc/inet/rpc/rcmd.c
@@ -39,6 +39,10 @@ static char sccsid[] = "@(#)rcmd.c 8.3 (Berkeley) 3/26/94";
#define sysconf __sysconf
#define getline __getline
#define geteuid __geteuid
+#define seteuid __seteuid
+#define getpwnam_r __getpwnam_r
+#define gethostbyname __gethostbyname
+#define gethostbyname_r __gethostbyname_r
#define __FORCE_GLIBC
#include <features.h>
diff --git a/libc/inet/rpc/rexec.c b/libc/inet/rpc/rexec.c
index e5e8d42de..98a8bf32e 100644
--- a/libc/inet/rpc/rexec.c
+++ b/libc/inet/rpc/rexec.c
@@ -27,6 +27,10 @@
* SUCH DAMAGE.
*/
+#define getnameinfo __getnameinfo
+#define getaddrinfo __getaddrinfo
+#define getsockname __getsockname
+
#define __FORCE_GLIBC
#include <features.h>
#include <sys/types.h>
diff --git a/libc/inet/rpc/rpc_prot.c b/libc/inet/rpc/rpc_prot.c
index 60cd5ff19..afc1dccd1 100644
--- a/libc/inet/rpc/rpc_prot.c
+++ b/libc/inet/rpc/rpc_prot.c
@@ -240,8 +240,8 @@ rejected (enum reject_stat rjct_stat,
/*
* given a reply message, fills in the error
*/
-void
-_seterr_reply (struct rpc_msg *msg,
+void attribute_hidden
+__seterr_reply (struct rpc_msg *msg,
struct rpc_err *error)
{
/* optimized for normal, SUCCESSful case */
@@ -285,3 +285,4 @@ _seterr_reply (struct rpc_msg *msg,
break;
}
}
+strong_alias(__seterr_reply,_seterr_reply)
diff --git a/libc/inet/rpc/ruserpass.c b/libc/inet/rpc/ruserpass.c
index 70a86969b..3c48122ac 100644
--- a/libc/inet/rpc/ruserpass.c
+++ b/libc/inet/rpc/ruserpass.c
@@ -32,6 +32,7 @@
#define getuid __getuid
#define getegid __getegid
#define geteuid __geteuid
+#define gethostname __gethostname
#define __FORCE_GLIBC
#include <features.h>
diff --git a/libc/inet/rpc/svc_tcp.c b/libc/inet/rpc/svc_tcp.c
index 888841a7d..32b3cc995 100644
--- a/libc/inet/rpc/svc_tcp.c
+++ b/libc/inet/rpc/svc_tcp.c
@@ -48,6 +48,7 @@ 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 getsockname __getsockname
#define __FORCE_GLIBC
#define _GNU_SOURCE
diff --git a/libc/inet/rpc/svc_udp.c b/libc/inet/rpc/svc_udp.c
index 8154ebf91..197084144 100644
--- a/libc/inet/rpc/svc_udp.c
+++ b/libc/inet/rpc/svc_udp.c
@@ -43,6 +43,7 @@ static char sccsid[] = "@(#)svc_udp.c 1.24 87/08/11 Copyr 1984 Sun Micro";
#define xdrmem_create __xdrmem_create
#define xdr_callmsg __xdr_callmsg
#define xdr_replymsg __xdr_replymsg
+#define getsockname __getsockname
#define __FORCE_GLIBC
#define _GNU_SOURCE
diff --git a/libc/inet/rpc/svc_unix.c b/libc/inet/rpc/svc_unix.c
index 3f10117e5..79c27ac5f 100644
--- a/libc/inet/rpc/svc_unix.c
+++ b/libc/inet/rpc/svc_unix.c
@@ -46,6 +46,7 @@
#define xprt_register __xprt_register
#define getegid __getegid
#define geteuid __geteuid
+#define getsockname __getsockname
#define __FORCE_GLIBC
#include <features.h>
diff --git a/libc/inet/socketcalls.c b/libc/inet/socketcalls.c
index 2215d2d99..1dbffa3d1 100644
--- a/libc/inet/socketcalls.c
+++ b/libc/inet/socketcalls.c
@@ -98,9 +98,11 @@ int getpeername(int sockfd, struct sockaddr *addr, socklen_t * paddrlen)
#ifdef L_getsockname
#ifdef __NR_getsockname
-_syscall3(int, getsockname, int, sockfd, struct sockaddr *, addr, socklen_t *,paddrlen);
+#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 getsockname(int sockfd, struct sockaddr *addr, socklen_t * paddrlen)
+int attribute_hidden __getsockname(int sockfd, struct sockaddr *addr, socklen_t * paddrlen)
{
unsigned long args[3];
@@ -109,6 +111,7 @@ int getsockname(int sockfd, struct sockaddr *addr, socklen_t * paddrlen)
args[2] = (unsigned long) paddrlen;
return __socketcall(SYS_GETSOCKNAME, args);
}
+strong_alias(__getsockname,getsockname)
#endif
#endif