summaryrefslogtreecommitdiff
path: root/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'common.c')
-rw-r--r--common.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/common.c b/common.c
index 8f87202..d11e602 100644
--- a/common.c
+++ b/common.c
@@ -125,3 +125,16 @@ void version(void)
printf(_("Compiled with:%s\n"), COMPILE_OPTS);
printf(_("Bugs to %s\n"), PACKAGE_BUGREPORT);
}
+
+int timespec_cmp(struct timespec *a, struct timespec *b)
+{
+ if (a->tv_sec < b->tv_sec)
+ return -1;
+ if (a->tv_sec > b->tv_sec)
+ return 1;
+ if (a->tv_nsec < b->tv_nsec)
+ return -1;
+ if (a->tv_nsec > b->tv_nsec)
+ return 1;
+ return 0;
+}