From ab6f0beb78d2c0b4af1c47f1d816829b9abac003 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 10 Dec 2013 07:54:21 +0100 Subject: swrap: Add libc_send(). --- src/socket_wrapper.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c index 4c308dd..0236a13 100644 --- a/src/socket_wrapper.c +++ b/src/socket_wrapper.c @@ -721,6 +721,13 @@ static int libc_recvfrom(int sockfd, return swrap.fns.libc_recvfrom(sockfd, buf, len, flags, src_addr, addrlen); } +static int libc_send(int sockfd, const void *buf, size_t len, int flags) +{ + swrap_load_lib_function(SWRAP_LIBSOCKET, send); + + return swrap.fns.libc_send(sockfd, buf, len, flags); +} + /********************************************************* * SWRAP HELPER FUNCTIONS *********************************************************/ @@ -3077,7 +3084,7 @@ static ssize_t swrap_send(int s, const void *buf, size_t len, int flags) struct socket_info *si = find_socket_info(s); if (!si) { - return swrap.fns.libc_send(s, buf, len, flags); + return libc_send(s, buf, len, flags); } tmp.iov_base = discard_const_p(char, buf); @@ -3100,7 +3107,7 @@ static ssize_t swrap_send(int s, const void *buf, size_t len, int flags) buf = msg.msg_iov[0].iov_base; len = msg.msg_iov[0].iov_len; - ret = swrap.fns.libc_send(s, buf, len, flags); + ret = libc_send(s, buf, len, flags); swrap_sendmsg_after(si, &msg, NULL, ret); -- cgit