From 4b72d3005246fb31ec038fc908729672df47364d Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 10 Dec 2013 08:12:16 +0100 Subject: swrap: Add libc_setsockopt(). --- src/socket_wrapper.c | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c index 2a23d19..9f9b8b4 100644 --- a/src/socket_wrapper.c +++ b/src/socket_wrapper.c @@ -747,6 +747,17 @@ static int libc_sendto(int sockfd, return swrap.fns.libc_sendto(sockfd, buf, len, flags, dst_addr, addrlen); } +static int libc_setsockopt(int sockfd, + int level, + int optname, + const void *optval, + socklen_t optlen) +{ + swrap_load_lib_function(SWRAP_LIBSOCKET, setsockopt); + + return swrap.fns.libc_setsockopt(sockfd, level, optname, optval, optlen); +} + /********************************************************* * SWRAP HELPER FUNCTIONS *********************************************************/ @@ -2599,19 +2610,19 @@ static int swrap_setsockopt(int s, int level, int optname, struct socket_info *si = find_socket_info(s); if (!si) { - return swrap.fns.libc_setsockopt(s, - level, - optname, - optval, - optlen); + return libc_setsockopt(s, + level, + optname, + optval, + optlen); } if (level == SOL_SOCKET) { - return swrap.fns.libc_setsockopt(s, - level, - optname, - optval, - optlen); + return libc_setsockopt(s, + level, + optname, + optval, + optlen); } switch (si->family) { -- cgit