Version: 1
-Previous: b2efbe2c635c284f122cdbeb76d76e66cc5df79b
+Previous: 512cf9d8612ab13a6c08b41f0fa44caf4a60a583
Head: c7a4fab9033f46361b1f637448d4af01e59cb6a6
Applied:
real-close: 3409f8d6af187d25c63a5d1f8ee8bff5f14555e2
dup2: ca5813e7cf95dee5933fc417e4a34d26f2b01824
fstat: 07e07a6ee41d57eb20b3b71b1d8098408fc1de03
+ dbg-out: c7a4fab9033f46361b1f637448d4af01e59cb6a6
Unapplied:
- dbg-out: abe42e50924367870177ad006afb6a35bf024afb
dbg: 0c269855776d3001e37da8c8afe283c20e1d6cd6
waitall-buggy: c49c6b56c55385774065f5aa2704078e6ae0ceb8
rs-1sge: 8ec392829399dec7ed5c608b8697a482e5faa2de
-Bottom: 7bf18695fef78ce1cf020b98bda96e2687917519
-Top: d375a8c3b149a38d9c0e691a32801dcd2977c4e9
+Bottom: 8706747d8841cecefce6c394ef08bec016dd0348
+Top: 8706747d8841cecefce6c394ef08bec016dd0348
Author: Sean Hefty <sean.hefty@intel.com>
Date: 2012-08-07 11:08:30 -0700
---
-diff --git a/src/preload.c b/src/preload.c
-index 33eb9a3..4ebcc85 100644
---- a/src/preload.c
-+++ b/src/preload.c
-@@ -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>
-@@ -84,7 +85,7 @@ struct socket_calls {
- void *optval, socklen_t *optlen);
- int (*fcntl)(int socket, int cmd, ... /* arg */);
- int (*dup2)(int oldfd, int newfd);
-- int (*fstat)(int fd, struct stat *buf);
-+ int (*fxstat64)(int ver, int fd, struct stat64 *buf);
- };
-
- static struct socket_calls real;
-@@ -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,
-@@ -260,7 +263,7 @@ static void init_preload(void)
- real.getsockopt = dlsym(RTLD_NEXT, "getsockopt");
- real.fcntl = dlsym(RTLD_NEXT, "fcntl");
- real.dup2 = dlsym(RTLD_NEXT, "dup2");
-- real.fstat = dlsym(RTLD_NEXT, "fstat");
-+ real.fxstat64 = dlsym(RTLD_NEXT, "__fxstat64");
-
- rs.socket = dlsym(RTLD_DEFAULT, "rsocket");
- rs.bind = dlsym(RTLD_DEFAULT, "rbind");
-@@ -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:
-@@ -964,16 +968,21 @@ int dup2(int oldfd, int newfd)
- return newfd;
- }
-
--int fstat(int socket, struct stat *buf)
-+int __fxstat64(int ver, int socket, struct stat64 *buf)
- {
- int fd, ret;
-
-+ init_preload();
-+ fprintf(fout, "fxstat64 socket %d\n", socket);
- if (fd_get(socket, &fd) == fd_rsocket) {
-- ret = real.fstat(socket, buf);
-+ ret = real.fxstat64(ver, socket, buf);
-+ fprintf(fout, "fxstat64 - rsocket %d\n", ret);
- if (!ret)
- buf->st_mode = (buf->st_mode & ~S_IFMT) | __S_IFSOCK;
- } else {
-- ret = real.fstat(fd, buf);
-+ ret = real.fxstat64(ver, fd, buf);
-+ fprintf(fout, "fxstat64 - normal %d\n", ret);
- }
-+ fflush(fout);
- return ret;
- }
+