summaryrefslogtreecommitdiffstats
path: root/booster
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@zresearch.com>2009-05-05 16:03:02 +0530
committerAnand V. Avati <avati@amp.gluster.com>2009-05-05 17:46:50 +0530
commit1504e1d50c7efcf20fe55fc7db526bb1d364244a (patch)
tree400930c0a3436eeca1209d8bd02277c6a47dfde5 /booster
parent48e30d6715574c34bc760798e1657b5900129c25 (diff)
booster: Add symlink API
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'booster')
-rw-r--r--booster/src/booster.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/booster/src/booster.c b/booster/src/booster.c
index 64d769da319..f2ae494c3b6 100644
--- a/booster/src/booster.c
+++ b/booster/src/booster.c
@@ -164,6 +164,7 @@ static int (*real_utime) (const char *path, const struct utimbuf *buf);
static int (*real_mknod) (const char *path, mode_t mode, dev_t dev);
static int (*real_mkfifo) (const char *path, mode_t mode);
static int (*real_unlink) (const char *path);
+static int (*real_symlink) (const char *oldpath, const char *newpath);
#define RESOLVE(sym) do { \
if (!real_##sym) \
@@ -1427,6 +1428,24 @@ unlink (const char *path)
return ret;
}
+int
+symlink (const char *oldpath, const char *newpath)
+{
+ int ret = -1;
+
+ ret = glusterfs_symlink (oldpath, newpath);
+ if (((ret == -1) && (errno != ENODEV)) || (ret == 0))
+ return ret;
+
+ if (real_symlink == NULL) {
+ errno = ENOSYS;
+ ret = -1;
+ } else
+ ret = real_symlink (oldpath, newpath);
+
+ return ret;
+}
+
pid_t
fork (void)
{
@@ -1491,6 +1510,7 @@ _init (void)
RESOLVE (mknod);
RESOLVE (mkfifo);
RESOLVE (unlink);
+ RESOLVE (symlink);
/* This must be called after resolving real functions
* above so that the socket based IO calls in libglusterfsclient