summaryrefslogtreecommitdiffstats
path: root/booster/src/booster.c
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@zresearch.com>2009-05-05 16:04:08 +0530
committerAnand V. Avati <avati@amp.gluster.com>2009-05-05 17:50:55 +0530
commit4de7dc7151d307021177107fcf8dd636b306bb59 (patch)
tree9dd4e0e0aa2bef56fc9ace4db6d16ee96fc0b133 /booster/src/booster.c
parent13a58f94a781d91ab3d7854996df66c9802d972b (diff)
booster: Add lstat API
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'booster/src/booster.c')
-rw-r--r--booster/src/booster.c94
1 files changed, 94 insertions, 0 deletions
diff --git a/booster/src/booster.c b/booster/src/booster.c
index 40a0ca87d83..60213210e9d 100644
--- a/booster/src/booster.c
+++ b/booster/src/booster.c
@@ -178,6 +178,10 @@ static int (*real___fxstat) (int ver, int fd, struct stat *buf);
static int (*real___fxstat64) (int ver, int fd, struct stat64 *buf);
static int (*real_fstat) (int fd, struct stat *buf);
static int (*real_fstat64) (int fd , struct stat64 *buf);
+static int (*real___lxstat) (int ver, const char *path, struct stat *buf);
+static int (*real___lxstat64) (int ver, const char *path, struct stat64 *buf);
+static int (*real_lstat) (const char *path, struct stat *buf);
+static int (*real_lstat64) (const char *path, struct stat64 *buf);
#define RESOLVE(sym) do { \
@@ -1792,6 +1796,92 @@ out:
return ret;
}
+int
+booster_lxstat (int ver, const char *path, void *buf)
+{
+ struct stat *sbuf = (struct stat *)buf;
+ int ret = -1;
+
+ ret = glusterfs_lstat (path, sbuf);
+ if (((ret == -1) && (errno != ENODEV)) || (ret == 0))
+ goto out;
+
+ if (real___lxstat == NULL) {
+ ret = -1;
+ errno = ENOSYS;
+ goto out;
+ }
+
+ ret = real___lxstat (ver, path, sbuf);
+out:
+ return ret;
+}
+
+int
+booster_lxstat64 (int ver, const char *path, void *buf)
+{
+ int ret = -1;
+ struct stat64 *sbuf = (struct stat64 *)buf;
+
+ ret = glusterfs_lstat (path, (struct stat *)sbuf);
+ if (((ret == -1) && (errno != ENODEV)) || (ret == 0))
+ goto out;
+
+ if (real___lxstat64 == NULL) {
+ errno = ENOSYS;
+ ret = -1;
+ goto out;
+ }
+
+ ret = real___lxstat64 (ver, path, sbuf);
+out:
+ return ret;
+}
+
+int
+booster_lstat (const char *path, void *buf)
+{
+ struct stat *sbuf = (struct stat *)buf;
+ int ret = -1;
+
+ ret = glusterfs_lstat (path, sbuf);
+ if (((ret == -1) && (errno != ENODEV)) || (ret == 0))
+ goto out;
+
+ if (real_lstat == NULL) {
+ errno = ENOSYS;
+ ret = -1;
+ goto out;
+ }
+
+ ret = real_lstat (path, sbuf);
+
+out:
+ return ret;
+}
+
+int
+booster_lstat64 (const char *path, void *buf)
+{
+ int ret = -1;
+ struct stat64 *sbuf = (struct stat64 *)buf;
+
+ ret = glusterfs_lstat (path, (struct stat *)sbuf);
+ if (((ret == -1) && (errno != ENODEV)) || (ret == 0))
+ goto out;
+
+ if (real_lstat64 == NULL) {
+ errno = ENOSYS;
+ ret = -1;
+ goto out;
+ }
+
+ ret = real_lstat64 (path, sbuf);
+out:
+ return ret;
+}
+
+
pid_t
fork (void)
{
@@ -1870,6 +1960,10 @@ _init (void)
RESOLVE (__fxstat64);
RESOLVE (fstat);
RESOLVE (fstat64);
+ RESOLVE (__lxstat);
+ RESOLVE (__lxstat64);
+ RESOLVE (lstat);
+ RESOLVE (lstat64);
/* This must be called after resolving real functions
* above so that the socket based IO calls in libglusterfsclient