summaryrefslogtreecommitdiff
path: root/lib/gettime.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gettime.c')
-rw-r--r--lib/gettime.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/gettime.c b/lib/gettime.c
index 44151566112..a44a69dfc43 100644
--- a/lib/gettime.c
+++ b/lib/gettime.c
@@ -1,7 +1,6 @@
/* gettime -- get the system clock
- Copyright (C) 2002, 2004-2007, 2009-2022 Free Software Foundation,
- Inc.
+ Copyright (C) 2002, 2004-2007, 2009-2022 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -31,6 +30,8 @@ gettime (struct timespec *ts)
{
#if defined CLOCK_REALTIME && HAVE_CLOCK_GETTIME
clock_gettime (CLOCK_REALTIME, ts);
+#elif defined HAVE_TIMESPEC_GET
+ timespec_get (ts, TIME_UTC);
#else
struct timeval tv;
gettimeofday (&tv, NULL);