summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2013-12-10 08:15:08 +0100
committerAndreas Schneider <asn@cryptomilk.org>2013-12-10 08:15:08 +0100
commitd344002876675e8a77f4d93303b8c2448fe02489 (patch)
treee2a9bbd00362ab9d471326acea63c0c20ed2e5c4
parent4b72d3005246fb31ec038fc908729672df47364d (diff)
downloadsocket_wrapper-d344002876675e8a77f4d93303b8c2448fe02489.tar.gz
socket_wrapper-d344002876675e8a77f4d93303b8c2448fe02489.tar.xz
socket_wrapper-d344002876675e8a77f4d93303b8c2448fe02489.zip
swrap: Add libc_socket().
-rw-r--r--src/socket_wrapper.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c
index 9f9b8b4..e298c31 100644
--- a/src/socket_wrapper.c
+++ b/src/socket_wrapper.c
@@ -758,6 +758,13 @@ static int libc_setsockopt(int sockfd,
return swrap.fns.libc_setsockopt(sockfd, level, optname, optval, optlen);
}
+static int libc_socket(int domain, int type, int protocol)
+{
+ swrap_load_lib_function(SWRAP_LIBSOCKET, socket);
+
+ return swrap.fns.libc_socket(domain, type, protocol);
+}
+
/*********************************************************
* SWRAP HELPER FUNCTIONS
*********************************************************/
@@ -2012,7 +2019,7 @@ static int swrap_socket(int family, int type, int protocol)
#endif
if (!swrap_enabled()) {
- return swrap.fns.libc_socket(family, type, protocol);
+ return libc_socket(family, type, protocol);
}
switch (family) {
@@ -2022,7 +2029,7 @@ static int swrap_socket(int family, int type, int protocol)
#endif
break;
case AF_UNIX:
- return swrap.fns.libc_socket(family, type, protocol);
+ return libc_socket(family, type, protocol);
default:
errno = EAFNOSUPPORT;
return -1;
@@ -2060,7 +2067,7 @@ static int swrap_socket(int family, int type, int protocol)
* We must call libc_socket with type, from the caller, not the version
* we removed SOCK_CLOEXEC and SOCK_NONBLOCK from
*/
- fd = swrap.fns.libc_socket(AF_UNIX, type, 0);
+ fd = libc_socket(AF_UNIX, type, 0);
if (fd == -1) return -1;