From 48ee90ab87cf0c01fee0188728d70d67c6724b97 Mon Sep 17 00:00:00 2001 From: Shehjar Tikoo Date: Tue, 5 May 2009 16:02:24 +0530 Subject: booster: Add utimes API Signed-off-by: Anand V. Avati --- booster/src/booster.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/booster/src/booster.c b/booster/src/booster.c index 681423277..80bac3a2f 100644 --- a/booster/src/booster.c +++ b/booster/src/booster.c @@ -158,6 +158,7 @@ static int (*real_fsync) (int fd); static int (*real_ftruncate) (int fd, off_t length); 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]); #define RESOLVE(sym) do { \ if (!real_##sym) \ @@ -1330,6 +1331,24 @@ rename (const char *old, const char *new) return ret; } +int +utimes (const char *path, const struct timeval times[2]) +{ + int ret = -1; + + ret = glusterfs_utimes (path, times); + if (((ret == -1) && (errno != ENODEV)) || (ret == 0)) + return ret; + + if (real_utimes == NULL) { + errno = ENOSYS; + ret = -1; + } else + ret = real_utimes (path, times); + + return ret; +} + pid_t fork (void) { @@ -1389,6 +1408,7 @@ _init (void) RESOLVE (ftruncate); RESOLVE (link); RESOLVE (rename); + RESOLVE (utimes); /* This must be called after resolving real functions * above so that the socket based IO calls in libglusterfsclient -- cgit