summaryrefslogtreecommitdiffstats
path: root/include/timeutils.h
diff options
context:
space:
mode:
authorSami Kerola2016-07-12 23:21:10 +0200
committerSami Kerola2017-02-03 23:31:18 +0100
commitb72a75e993d60d50cb9ed067aaf83197b3b1c9e1 (patch)
treef02324bcf2a47c22d6e6cf3a41c484a833589586 /include/timeutils.h
parenthwclock: remove UTC-0 localization hack (diff)
downloadkernel-qcow2-util-linux-b72a75e993d60d50cb9ed067aaf83197b3b1c9e1.tar.gz
kernel-qcow2-util-linux-b72a75e993d60d50cb9ed067aaf83197b3b1c9e1.tar.xz
kernel-qcow2-util-linux-b72a75e993d60d50cb9ed067aaf83197b3b1c9e1.zip
lib: add timegm() portability function to lib/timeutils.c
Local timegm() is a replacement function in cases it is missing from libc implementation. Hopefully the replacement is never, or very rarely, used. CC: Ruediger Meier <ruediger.meier@ga-group.nl> Reviewed-by: J William Piggott <elseifthen@gmx.com> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'include/timeutils.h')
-rw-r--r--include/timeutils.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/timeutils.h b/include/timeutils.h
index 00d18200d..85fc228db 100644
--- a/include/timeutils.h
+++ b/include/timeutils.h
@@ -78,4 +78,8 @@ int time_is_thisyear(const time_t *t, struct timeval *now);
int strtime_short(const time_t *t, struct timeval *now, int flags, char *buf, size_t bufsz);
+#ifndef HAVE_TIMEGM
+extern time_t timegm(struct tm *tm);
+#endif
+
#endif /* UTIL_LINUX_TIME_UTIL_H */