summaryrefslogtreecommitdiffstats
path: root/booster
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@zresearch.com>2009-05-05 16:01:09 +0530
committerAnand V. Avati <avati@amp.gluster.com>2009-05-05 17:45:17 +0530
commit93c3a887695fc4fa7a65d6556398cffcf22d099e (patch)
treee6f9d318fa3eafefebf656260c1e3309d7f47519 /booster
parent358d3e7f99ecdc48c044f11f9f6011805d061ec4 (diff)
booster: Add mkdir API
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'booster')
-rw-r--r--booster/src/booster.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/booster/src/booster.c b/booster/src/booster.c
index 4fad0bd06fa..e91f6c30ce6 100644
--- a/booster/src/booster.c
+++ b/booster/src/booster.c
@@ -148,6 +148,7 @@ static int (*real_dup) (int fd);
static int (*real_dup2) (int oldfd, int newfd);
static pid_t (*real_fork) (void);
+static int (*real_mkdir) (const char *pathname, mode_t mode);
#define RESOLVE(sym) do { \
if (!real_##sym) \
@@ -1005,6 +1006,25 @@ dup2 (int oldfd, int newfd)
return ret;
}
+int
+mkdir (const char *pathname, mode_t mode)
+{
+ int ret = -1;
+
+ ret = glusterfs_mkdir (pathname, mode);
+
+ if (((ret == -1) && (errno != ENODEV)) || (ret == 0))
+ return ret;
+
+ if (real_mkdir == NULL) {
+ ret = -1;
+ errno = ENOSYS;
+ } else
+ ret = real_mkdir (pathname, mode);
+
+ return ret;
+}
+
#define MOUNT_TABLE_HASH_SIZE 256
@@ -1175,6 +1195,7 @@ _init (void)
RESOLVE (dup2);
RESOLVE (fork);
+ RESOLVE (mkdir);
/* This must be called after resolving real functions
* above so that the socket based IO calls in libglusterfsclient