diff options
Diffstat (limited to 'src/socket_wrapper.c')
| -rw-r--r-- | src/socket_wrapper.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c index 869128a..a6ad365 100644 --- a/src/socket_wrapper.c +++ b/src/socket_wrapper.c @@ -346,6 +346,17 @@ static int real_send(int sockfd, const void *buf, size_t len, int flags) return libc_send(sockfd, buf, len, flags); } +static int (*libc_sendmsg)(int sockfd, const struct msghdr *msg, int flags); + +static int real_sendmsg(int sockfd, const struct msghdr *msg, int flags) +{ + if (libc_sendmsg == NULL) { + *(void **)(&libc_sendmsg) = libc_dlsym("sendmsg"); + } + + return libc_sendmsg(sockfd, msg, flags); +} + static int (*libc_sendto)(int sockfd, const void *buf, size_t len, int flags, const struct sockaddr *dst_addr, socklen_t addrlen); @@ -2595,8 +2606,7 @@ ssize_t send(int s, const void *buf, size_t len, int flags) return ret; } -#if 0 -_PUBLIC_ ssize_t swrap_sendmsg(int s, const struct msghdr *omsg, int flags) +ssize_t sendmsg(int s, const struct msghdr *omsg, int flags) { struct msghdr msg; struct iovec tmp; @@ -2689,6 +2699,7 @@ _PUBLIC_ ssize_t swrap_sendmsg(int s, const struct msghdr *omsg, int flags) return ret; } +#if 0 int swrap_readv(int s, const struct iovec *vector, size_t count) { int ret; |
