diff options
author | Shehjar Tikoo <shehjart@zresearch.com> | 2009-05-05 16:02:48 +0530 |
---|---|---|
committer | Anand V. Avati <avati@amp.gluster.com> | 2009-05-05 17:46:28 +0530 |
commit | 62b29b0db6f7d417a3281c3937bd5af20e1bf201 (patch) | |
tree | 21d40cbddbdfc90000397e48360bd6519a996dff | |
parent | 7d87f8f5ce56278f56427196b5e2c5e4c0be02ad (diff) |
booster: Add mkfifo API
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
-rw-r--r-- | booster/src/booster.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/booster/src/booster.c b/booster/src/booster.c index b208b3bd6..a14fb799d 100644 --- a/booster/src/booster.c +++ b/booster/src/booster.c @@ -162,6 +162,7 @@ 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); +static int (*real_mkfifo) (const char *path, mode_t mode); #define RESOLVE(sym) do { \ if (!real_##sym) \ @@ -1389,6 +1390,24 @@ mknod (const char *path, mode_t mode, dev_t dev) return ret; } +int +mkfifo (const char *path, mode_t mode) +{ + int ret = -1; + + ret = glusterfs_mkfifo (path, mode); + if (((ret == -1) && (errno != ENODEV)) || (ret == 0)) + return ret; + + if (real_mkfifo == NULL) { + errno = ENOSYS; + ret = -1; + } else + ret = real_mkfifo (path, mode); + + return ret; +} + pid_t fork (void) { @@ -1451,6 +1470,7 @@ _init (void) RESOLVE (utimes); RESOLVE (utime); RESOLVE (mknod); + RESOLVE (mkfifo); /* This must be called after resolving real functions * above so that the socket based IO calls in libglusterfsclient |