summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/syscall.c
diff options
context:
space:
mode:
authorNiklas Hambüchen <mail@nh2.me>2017-02-18 00:49:02 +0100
committerJeff Darcy <jdarcy@redhat.com>2017-03-07 12:10:02 -0500
commitce8d8195dc253a87cceaaeeb1a725090471ae4f8 (patch)
tree87c027440d7a6af44956861b34fec3844d699038 /libglusterfs/src/syscall.c
parent89c6bedc1c2e978f67ca29f212a357984cd8a2dd (diff)
posix: use nanosecond accuracy when available
Programs that set mtime, such as `rsync -a`, don't work correctly on GlusterFS, because it sets the nanoseconds to 000. This creates problems for incremental backups, where files get accidentally copied again and again. For example, consider `myfile` on an ext4 system, being copied to a GlusterFS volume, with `rsync -a` and then `cp -u` in turn. You'd expect that after the first `rsync -a`, `cp -u` agrees that the file need not be copied. BUG: 1422074 Change-Id: I89c7b6a73e2e06c02851ff76b7e5cdfaa271e985 Signed-off-by: Niklas Hambüchen <mail@nh2.me> Reviewed-on: https://review.gluster.org/16667 Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: Jeff Darcy <jdarcy@redhat.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: jiffin tony Thottan <jthottan@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'libglusterfs/src/syscall.c')
-rw-r--r--libglusterfs/src/syscall.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libglusterfs/src/syscall.c b/libglusterfs/src/syscall.c
index 4e4c6a728da..a7d4402808d 100644
--- a/libglusterfs/src/syscall.c
+++ b/libglusterfs/src/syscall.c
@@ -272,6 +272,16 @@ sys_utimes (const char *filename, const struct timeval times[2])
}
+#if defined(HAVE_UTIMENSAT)
+int
+sys_utimensat (int dirfd, const char *filename, const struct timespec times[2],
+ int flags)
+{
+ return utimensat (dirfd, filename, times, flags);
+}
+#endif
+
+
int
sys_creat (const char *pathname, mode_t mode)
{