summaryrefslogtreecommitdiff
path: root/libc/inet/socketcalls.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/inet/socketcalls.c')
-rw-r--r--libc/inet/socketcalls.c83
1 files changed, 26 insertions, 57 deletions
diff --git a/libc/inet/socketcalls.c b/libc/inet/socketcalls.c
index d9103ea9f..c84a51905 100644
--- a/libc/inet/socketcalls.c
+++ b/libc/inet/socketcalls.c
@@ -35,12 +35,10 @@ extern int __socketcall(int call, unsigned long *args) attribute_hidden;
#ifdef L_accept
-extern __typeof(accept) __libc_accept;
#ifdef __NR_accept
-#define __NR___libc_accept __NR_accept
-_syscall3(int, __libc_accept, int, call, struct sockaddr *, addr, socklen_t *,addrlen)
+_syscall3(int, accept, int, call, struct sockaddr *, addr, socklen_t *,addrlen)
#elif defined(__NR_socketcall)
-int __libc_accept(int s, struct sockaddr *addr, socklen_t * addrlen)
+int accept(int s, struct sockaddr *addr, socklen_t * addrlen)
{
unsigned long args[3];
@@ -50,9 +48,7 @@ int __libc_accept(int s, struct sockaddr *addr, socklen_t * addrlen)
return __socketcall(SYS_ACCEPT, args);
}
#endif
-/* libc_hidden_proto(accept) */
-weak_alias(__libc_accept,accept)
-libc_hidden_weak(accept)
+libc_hidden_def(accept)
#endif
#ifdef L_bind
@@ -74,12 +70,10 @@ libc_hidden_def(bind)
#endif
#ifdef L_connect
-extern __typeof(connect) __libc_connect;
#ifdef __NR_connect
-#define __NR___libc_connect __NR_connect
-_syscall3(int, __libc_connect, int, sockfd, const struct sockaddr *, saddr, socklen_t, addrlen)
+_syscall3(int, connect, int, sockfd, const struct sockaddr *, saddr, socklen_t, addrlen)
#elif defined(__NR_socketcall)
-int __libc_connect(int sockfd, const struct sockaddr *saddr, socklen_t addrlen)
+int connect(int sockfd, const struct sockaddr *saddr, socklen_t addrlen)
{
unsigned long args[3];
@@ -89,9 +83,7 @@ int __libc_connect(int sockfd, const struct sockaddr *saddr, socklen_t addrlen)
return __socketcall(SYS_CONNECT, args);
}
#endif
-/* libc_hidden_proto(connect) */
-weak_alias(__libc_connect,connect)
-libc_hidden_weak(connect)
+libc_hidden_def(connect)
#endif
#ifdef L_getpeername
@@ -165,14 +157,12 @@ libc_hidden_def(listen)
#endif
#ifdef L_recv
-extern __typeof(recv) __libc_recv;
#ifdef __NR_recv
-#define __NR___libc_recv __NR_recv
-_syscall4(ssize_t, __libc_recv, int, sockfd, __ptr_t, buffer, size_t, len,
+_syscall4(ssize_t, recv, int, sockfd, __ptr_t, buffer, size_t, len,
int, flags)
#elif defined(__NR_socketcall)
/* recv, recvfrom added by bir7@leland.stanford.edu */
-ssize_t __libc_recv(int sockfd, __ptr_t buffer, size_t len, int flags)
+ssize_t recv(int sockfd, __ptr_t buffer, size_t len, int flags)
{
unsigned long args[4];
@@ -184,25 +174,21 @@ ssize_t __libc_recv(int sockfd, __ptr_t buffer, size_t len, int flags)
}
#elif defined(__NR_recvfrom)
/* libc_hidden_proto(recvfrom) */
-ssize_t __libc_recv(int sockfd, __ptr_t buffer, size_t len, int flags)
+ssize_t recv(int sockfd, __ptr_t buffer, size_t len, int flags)
{
return (recvfrom(sockfd, buffer, len, flags, NULL, NULL));
}
#endif
-/* libc_hidden_proto(recv) */
-weak_alias(__libc_recv,recv)
-libc_hidden_weak(recv)
+libc_hidden_def(recv)
#endif
#ifdef L_recvfrom
-extern __typeof(recvfrom) __libc_recvfrom;
#ifdef __NR_recvfrom
-#define __NR___libc_recvfrom __NR_recvfrom
-_syscall6(ssize_t, __libc_recvfrom, int, sockfd, __ptr_t, buffer, size_t, len,
+_syscall6(ssize_t, recvfrom, int, sockfd, __ptr_t, buffer, size_t, len,
int, flags, struct sockaddr *, to, socklen_t *, tolen)
#elif defined(__NR_socketcall)
/* recv, recvfrom added by bir7@leland.stanford.edu */
-ssize_t __libc_recvfrom(int sockfd, __ptr_t buffer, size_t len, int flags,
+ssize_t recvfrom(int sockfd, __ptr_t buffer, size_t len, int flags,
struct sockaddr *to, socklen_t * tolen)
{
unsigned long args[6];
@@ -216,18 +202,14 @@ ssize_t __libc_recvfrom(int sockfd, __ptr_t buffer, size_t len, int flags,
return (__socketcall(SYS_RECVFROM, args));
}
#endif
-/* libc_hidden_proto(recvfrom) */
-weak_alias(__libc_recvfrom,recvfrom)
-libc_hidden_weak(recvfrom)
+libc_hidden_def(recvfrom)
#endif
#ifdef L_recvmsg
-extern __typeof(recvmsg) __libc_recvmsg;
#ifdef __NR_recvmsg
-#define __NR___libc_recvmsg __NR_recvmsg
-_syscall3(ssize_t, __libc_recvmsg, int, sockfd, struct msghdr *, msg, int, flags)
+_syscall3(ssize_t, recvmsg, int, sockfd, struct msghdr *, msg, int, flags)
#elif defined(__NR_socketcall)
-ssize_t __libc_recvmsg(int sockfd, struct msghdr *msg, int flags)
+ssize_t recvmsg(int sockfd, struct msghdr *msg, int flags)
{
unsigned long args[3];
@@ -237,19 +219,15 @@ ssize_t __libc_recvmsg(int sockfd, struct msghdr *msg, int flags)
return (__socketcall(SYS_RECVMSG, args));
}
#endif
-/* libc_hidden_proto(recvmsg) */
-weak_alias(__libc_recvmsg,recvmsg)
-libc_hidden_weak(recvmsg)
+libc_hidden_def(recvmsg)
#endif
#ifdef L_send
-extern __typeof(send) __libc_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)
+_syscall4(ssize_t, send, int, sockfd, const void *, buffer, size_t, len, int, flags)
#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)
+ssize_t send(int sockfd, const void *buffer, size_t len, int flags)
{
unsigned long args[4];
@@ -261,23 +239,20 @@ ssize_t __libc_send(int sockfd, const void *buffer, size_t len, int flags)
}
#elif defined(__NR_sendto)
/* libc_hidden_proto(sendto) */
-ssize_t __libc_send(int sockfd, const void *buffer, size_t len, int flags)
+ssize_t send(int sockfd, const void *buffer, size_t len, int flags)
{
return (sendto(sockfd, buffer, len, flags, NULL, 0));
}
#endif
/* libc_hidden_proto(send) */
-weak_alias(__libc_send,send)
-libc_hidden_weak(send)
+libc_hidden_def(send)
#endif
#ifdef L_sendmsg
-extern __typeof(sendmsg) __libc_sendmsg;
#ifdef __NR_sendmsg
-#define __NR___libc_sendmsg __NR_sendmsg
-_syscall3(ssize_t, __libc_sendmsg, int, sockfd, const struct msghdr *, msg, int, flags)
+_syscall3(ssize_t, sendmsg, int, sockfd, const struct msghdr *, msg, int, flags)
#elif defined(__NR_socketcall)
-ssize_t __libc_sendmsg(int sockfd, const struct msghdr *msg, int flags)
+ssize_t sendmsg(int sockfd, const struct msghdr *msg, int flags)
{
unsigned long args[3];
@@ -287,20 +262,16 @@ ssize_t __libc_sendmsg(int sockfd, const struct msghdr *msg, int flags)
return (__socketcall(SYS_SENDMSG, args));
}
#endif
-/* libc_hidden_proto(sendmsg) */
-weak_alias(__libc_sendmsg,sendmsg)
-libc_hidden_weak(sendmsg)
+libc_hidden_def(sendmsg)
#endif
#ifdef L_sendto
-extern __typeof(sendto) __libc_sendto;
#ifdef __NR_sendto
-#define __NR___libc_sendto __NR_sendto
-_syscall6(ssize_t, __libc_sendto, int, sockfd, const void *, buffer,
+_syscall6(ssize_t, sendto, int, sockfd, const void *, buffer,
size_t, len, int, flags, const struct sockaddr *, to, socklen_t, tolen)
#elif defined(__NR_socketcall)
/* send, sendto added by bir7@leland.stanford.edu */
-ssize_t __libc_sendto(int sockfd, const void *buffer, size_t len, int flags,
+ssize_t sendto(int sockfd, const void *buffer, size_t len, int flags,
const struct sockaddr *to, socklen_t tolen)
{
unsigned long args[6];
@@ -314,9 +285,7 @@ ssize_t __libc_sendto(int sockfd, const void *buffer, size_t len, int flags,
return (__socketcall(SYS_SENDTO, args));
}
#endif
-/* libc_hidden_proto(sendto) */
-weak_alias(__libc_sendto,sendto)
-libc_hidden_weak(sendto)
+libc_hidden_def(sendto)
#endif
#ifdef L_setsockopt