summaryrefslogtreecommitdiff
path: root/lib/gettime.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gettime.c')
-rw-r--r--lib/gettime.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/gettime.c b/lib/gettime.c
index 44151566112..541af18bbfa 100644
--- a/lib/gettime.c
+++ b/lib/gettime.c
@@ -1,11 +1,10 @@
/* 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
- published by the Free Software Foundation; either version 3 of the
+ published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This file is distributed in the hope that it will be useful,
@@ -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);