diff options
author | Mike Frysinger <vapier@gentoo.org> | 2005-06-29 22:09:29 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2005-06-29 22:09:29 +0000 |
commit | 7d0af1f89e4f9027dcabcfaf950416783eb22f95 (patch) | |
tree | 9c9486d0260c1b63b9104aa8824a33bf12555909 /libc | |
parent | 13f449ceaa5b21cea51ee2b182e80bd2319d1c75 (diff) |
if both __NR_send and __NR_socketcall do not exist, fall back to __NR_sendto (same goes for recv/recvfrom)
Diffstat (limited to 'libc')
-rw-r--r-- | libc/inet/socketcalls.c | 12 |
1 files changed, 12 insertions, 0 deletions
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 |