summaryrefslogtreecommitdiffstats
path: root/booster
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@zresearch.com>2009-05-05 16:02:38 +0530
committerAnand V. Avati <avati@amp.gluster.com>2009-05-05 17:46:23 +0530
commit7d87f8f5ce56278f56427196b5e2c5e4c0be02ad (patch)
treea3ff51fc9cb52f4176b19cb0f6571421fd68f588 /booster
parent4311e7f01dc244baa1a1b8fc50f74a823dbd38c4 (diff)
booster: Add mknod 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 7bb2b64e2f2..b208b3bd687 100644
--- a/booster/src/booster.c
+++ b/booster/src/booster.c
@@ -161,6 +161,7 @@ static int (*real_link) (const char *oldpath, const char *newname);
static int (*real_rename) (const char *oldpath, const char *newpath);
static int (*real_utimes) (const char *path, const struct timeval times[2]);
static int (*real_utime) (const char *path, const struct utimbuf *buf);
+static int (*real_mknod) (const char *path, mode_t mode, dev_t dev);
#define RESOLVE(sym) do { \
if (!real_##sym) \
@@ -1370,6 +1371,24 @@ utime (const char *path, const struct utimbuf *buf)
return ret;
}
+int
+mknod (const char *path, mode_t mode, dev_t dev)
+{
+ int ret = -1;
+
+ ret = glusterfs_mknod (path, mode, dev);
+ if (((ret == -1) && (errno != ENODEV)) || (ret == 0))
+ return ret;
+
+ if (real_mknod) {
+ errno = ENOSYS;
+ ret = -1;
+ } else
+ ret = real_mknod (path, mode, dev);
+
+ return ret;
+}
+
pid_t
fork (void)
{
@@ -1431,6 +1450,7 @@ _init (void)
RESOLVE (rename);
RESOLVE (utimes);
RESOLVE (utime);
+ RESOLVE (mknod);
/* This must be called after resolving real functions
* above so that the socket based IO calls in libglusterfsclient