#include <netinet/tcp.h>
#include <unistd.h>
#include <semaphore.h>
+#include <stdio.h>
#include <rdma/rdma_cma.h>
#include <rdma/rdma_verbs.h>
static int sq_inline;
static int fork_support;
+static FILE *fout;
+
enum fd_type {
fd_normal,
fd_rsocket,
rs.getsockopt = dlsym(RTLD_DEFAULT, "rgetsockopt");
rs.fcntl = dlsym(RTLD_DEFAULT, "rfcntl");
+ fout = fopen("rs-out.txt", "w+");
getenv_options();
init = 1;
out:
return newfd;
}
-int fstat(int socket, struct stat *buf)
+int __fxstat64(int ver, int socket, struct stat *buf)
{
int fd, ret;
+ init_preload();
+ fprintf(fout, "fstat socket %d\n", socket);
if (fd_get(socket, &fd) == fd_rsocket) {
ret = real.fstat(socket, buf);
+ fprintf(fout, "fstat - rsocket %d\n", ret);
if (!ret)
buf->st_mode = (buf->st_mode & ~S_IFMT) | __S_IFSOCK;
} else {
ret = real.fstat(fd, buf);
+ fprintf(fout, "fstat - normal %d\n", ret);
}
+ fflush(fout);
return ret;
}