diff options
author | Peter S. Mazinger <ps.m@gmx.net> | 2011-03-21 12:53:25 +0100 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2012-06-15 14:00:30 +0200 |
commit | 7bc58308afc072fd5cff0e952b13493c55b300de (patch) | |
tree | 221e543d01f674bb05a3ea987a86dc97f2b8991c /libc/inet | |
parent | fc352aa35c546b9ceb7ba6e49f4b1f8441210f60 (diff) |
socketcalls.c: prefer using recvfrom in recv and sendto in send
Make socketcall the last alternative.
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'libc/inet')
-rw-r--r-- | libc/inet/socketcalls.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/libc/inet/socketcalls.c b/libc/inet/socketcalls.c index 7ee3670eb..5b6ced378 100644 --- a/libc/inet/socketcalls.c +++ b/libc/inet/socketcalls.c @@ -267,6 +267,11 @@ ssize_t __libc_recv(int sockfd, __ptr_t buffer, size_t len, int flags) return result; #endif } +#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)); +} #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) @@ -288,11 +293,6 @@ ssize_t __libc_recv(int sockfd, __ptr_t buffer, size_t len, int flags) return result; #endif } -#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)); -} #endif weak_alias(__libc_recv,recv) libc_hidden_weak(recv) @@ -407,6 +407,11 @@ ssize_t __libc_send(int sockfd, const void *buffer, size_t len, int flags) return result; #endif } +#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)); +} #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) @@ -429,11 +434,6 @@ ssize_t __libc_send(int sockfd, const void *buffer, size_t len, int flags) #endif } -#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)); -} #endif weak_alias(__libc_send,send) libc_hidden_weak(send) |