summaryrefslogtreecommitdiffstats
path: root/src/vcl/vcom.c
diff options
context:
space:
mode:
authorDave Wallace <dwallacelf@gmail.com>2017-11-07 02:20:07 -0500
committerFlorin Coras <florin.coras@gmail.com>2017-11-07 08:40:57 +0000
commit5917939256af392914d8a648de0c3287042ddbf6 (patch)
tree6e22c50d626bc999df401d8f19ab956378891e55 /src/vcl/vcom.c
parentbfc29ba442dbb65599f29fe5aa44c6219ed0d3a8 (diff)
VCL-LDPRELOAD: enable accept4() wrapper
Change-Id: I56567953fb8329315393047913e30fc7f2242bdb Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Diffstat (limited to 'src/vcl/vcom.c')
-rw-r--r--src/vcl/vcom.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/vcl/vcom.c b/src/vcl/vcom.c
index b215771e70c..ed52bfac8e4 100644
--- a/src/vcl/vcom.c
+++ b/src/vcl/vcom.c
@@ -2568,7 +2568,6 @@ accept (int __fd, __SOCKADDR_ARG __addr, socklen_t * __restrict __addr_len)
return libc_accept (__fd, __addr, __addr_len);
}
-#ifdef __USE_GNU
/*
* Similar to 'accept' but takes an additional parameter to specify
* flags.
@@ -2592,9 +2591,14 @@ int
accept4 (int __fd, __SOCKADDR_ARG __addr,
socklen_t * __restrict __addr_len, int __flags)
{
- int rv;
+ int rv = 0;
pid_t pid = getpid ();
+ fprintf (stderr,
+ "[%d] accept4: in the beginning... "
+ "'%04d'='%04d', '%p', '%p', '%04x'\n",
+ pid, rv, __fd, __addr, __addr_len, __flags);
+
if (is_vcom_socket_fd (__fd))
{
if (VCOM_DEBUG > 0)
@@ -2602,7 +2606,7 @@ accept4 (int __fd, __SOCKADDR_ARG __addr,
rv = vcom_accept4 (__fd, __addr, __addr_len, __flags);
if (VCOM_DEBUG > 0)
fprintf (stderr,
- "[%d] accept4: "
+ "[%d] accept4: VCL "
"'%04d'='%04d', '%p', '%p', '%04x'\n",
pid, rv, __fd, __addr, __addr_len, __flags);
if (VCOM_DEBUG > 0)
@@ -2614,11 +2618,14 @@ accept4 (int __fd, __SOCKADDR_ARG __addr,
}
return rv;
}
+ fprintf (stderr,
+ "[%d] accept4: libc "
+ "'%04d'='%04d', '%p', '%p', '%04x'\n",
+ pid, rv, __fd, __addr, __addr_len, __flags);
+
return libc_accept4 (__fd, __addr, __addr_len, __flags);
}
-#endif
-
/*
* Shut down all or part of the connection open on socket FD.
* HOW determines what to shut down:
@@ -2822,7 +2829,7 @@ epoll_wait (int __epfd, struct epoll_event *__events,
rv =
vcom_socket_epoll_pwait (__epfd, __events, __maxevents, __timeout, NULL);
- if (VCOM_DEBUG > 0)
+ if (VCOM_DEBUG > 1)
fprintf (stderr,
"[%d] epoll_wait: "
"'%04d'='%04d', '%p', "