From 7d0af1f89e4f9027dcabcfaf950416783eb22f95 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 29 Jun 2005 22:09:29 +0000 Subject: if both __NR_send and __NR_socketcall do not exist, fall back to __NR_sendto (same goes for recv/recvfrom) --- libc/inet/socketcalls.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'libc/inet') diff --git a/libc/inet/socketcalls.c b/libc/inet/socketcalls.c index f93d10952..35ab1d7a8 100644 --- a/libc/inet/socketcalls.c +++ b/libc/inet/socketcalls.c @@ -164,6 +164,12 @@ ssize_t __libc_recv(int sockfd, __ptr_t buffer, size_t len, int 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)); +} +weak_alias(__libc_recv, recv); #endif #endif @@ -227,6 +233,12 @@ ssize_t __libc_send(int sockfd, const void *buffer, size_t len, int flags) return (__socketcall(SYS_SEND, args)); } weak_alias(__libc_send, send); +#elif defined(__NR_sendto) +ssize_t __libc_send(int sockfd, const void *buffer, size_t len, int flags) +{ + return (sendto(sockfd, buffer, len, flags, NULL, 0)); +} +weak_alias(__libc_send, send); #endif #endif -- cgit v1.2.3