summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2013-12-10 07:54:21 +0100
committerAndreas Schneider <asn@cryptomilk.org>2013-12-10 07:57:21 +0100
commitab6f0beb78d2c0b4af1c47f1d816829b9abac003 (patch)
tree2bba9ef91e5b02fec08f92a88127a904d67b3b24
parentfb02405c73358d36e2cd08bd8d170bf2bbdb5b54 (diff)
downloadsocket_wrapper-ab6f0beb78d2c0b4af1c47f1d816829b9abac003.zip
socket_wrapper-ab6f0beb78d2c0b4af1c47f1d816829b9abac003.tar.gz
socket_wrapper-ab6f0beb78d2c0b4af1c47f1d816829b9abac003.tar.xz
swrap: Add libc_send().
-rw-r--r--src/socket_wrapper.c11
1 files 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);