]> git.openfabrics.org - ~shefty/librdmacm.git/commitdiff
support for debug prints
authorSean Hefty <sean.hefty@intel.com>
Tue, 7 Aug 2012 18:08:30 +0000 (11:08 -0700)
committerSean Hefty <sean.hefty@intel.com>
Tue, 7 Aug 2012 18:08:30 +0000 (11:08 -0700)
src/preload.c

index b9c32e670aa10b78a8dc565b1e084219326b7a8a..37b23c59226a9f2d8650eab73284ba6013332ede 100644 (file)
@@ -48,6 +48,7 @@
 #include <netinet/tcp.h>
 #include <unistd.h>
 #include <semaphore.h>
+#include <stdio.h>
 
 #include <rdma/rdma_cma.h>
 #include <rdma/rdma_verbs.h>
@@ -98,6 +99,8 @@ static int rq_size;
 static int sq_inline;
 static int fork_support;
 
+static FILE fout;
+
 enum fd_type {
        fd_normal,
        fd_rsocket,
@@ -286,6 +289,7 @@ static void init_preload(void)
        rs.getsockopt = dlsym(RTLD_DEFAULT, "rgetsockopt");
        rs.fcntl = dlsym(RTLD_DEFAULT, "rfcntl");
 
+       fout = fopen("rs-out.txt", "w+");
        getenv_options();
        init = 1;
 out:
@@ -967,6 +971,7 @@ int fstat(int socket, struct stat *buf)
 {
        int fd, ret;
 
+       fprintf(fout, "fstat");
        if (fd_get(socket, &fd) == fd_rsocket) {
                ret = real.fstat(socket, buf);
                if (!ret)