summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2013-12-09 19:36:02 +0100
committerAndreas Schneider <asn@cryptomilk.org>2013-12-09 19:36:02 +0100
commit7af4d587f80f4f981fdd45404a7e1ac725647c75 (patch)
tree4fe5797506c6b89147e5cf1888b33bbb9f4ade70
parent9dd5276ce25f10278aca8342adfc5bcf332cbeb7 (diff)
downloadsocket_wrapper-7af4d587f80f4f981fdd45404a7e1ac725647c75.zip
socket_wrapper-7af4d587f80f4f981fdd45404a7e1ac725647c75.tar.gz
socket_wrapper-7af4d587f80f4f981fdd45404a7e1ac725647c75.tar.xz
swrap: Add libc_getsockopt().
-rw-r--r--src/socket_wrapper.c31
1 files changed, 21 insertions, 10 deletions
diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c
index ca07550..b32af81 100644
--- a/src/socket_wrapper.c
+++ b/src/socket_wrapper.c
@@ -648,6 +648,17 @@ static int libc_getsockname(int sockfd,
return swrap.fns.libc_getsockname(sockfd, addr, addrlen);
}
+static int libc_getsockopt(int sockfd,
+ int level,
+ int optname,
+ void *optval,
+ socklen_t *optlen)
+{
+ swrap_load_lib_function(SWRAP_LIBSOCKET, getsockopt);
+
+ return swrap.fns.libc_getsockopt(sockfd, level, optname, optval, optlen);
+}
+
static int libc_vioctl(int d, unsigned long int request, va_list ap)
{
long int args[4];
@@ -2482,19 +2493,19 @@ static int swrap_getsockopt(int s, int level, int optname,
struct socket_info *si = find_socket_info(s);
if (!si) {
- return swrap.fns.libc_getsockopt(s,
- level,
- optname,
- optval,
- optlen);
+ return libc_getsockopt(s,
+ level,
+ optname,
+ optval,
+ optlen);
}
if (level == SOL_SOCKET) {
- return swrap.fns.libc_getsockopt(s,
- level,
- optname,
- optval,
- optlen);
+ return libc_getsockopt(s,
+ level,
+ optname,
+ optval,
+ optlen);
}
errno = ENOPROTOOPT;