4cfd1cae42
ok sthen@
26 lines
769 B
Plaintext
26 lines
769 B
Plaintext
$OpenBSD: patch-src_misc_mtime_c,v 1.1 2013/04/04 16:49:56 brad Exp $
|
|
|
|
Make use of clock_gettime() on OpenBSD. Until we have per-process
|
|
timers and can enable _POSIX_TIMERS in unistd.h.
|
|
|
|
--- src/misc/mtime.c.orig Wed Apr 3 19:04:51 2013
|
|
+++ src/misc/mtime.c Wed Apr 3 19:06:10 2013
|
|
@@ -42,7 +42,7 @@
|
|
#if !defined (_POSIX_TIMERS)
|
|
# define _POSIX_TIMERS (-1)
|
|
#endif
|
|
-#if (_POSIX_TIMERS > 0)
|
|
+#if (_POSIX_TIMERS > 0) || defined(__OpenBSD__)
|
|
# include <time.h> /* clock_gettime() */
|
|
#else
|
|
# include <sys/time.h>
|
|
@@ -234,7 +234,7 @@ mtime_t date_Decrement( date_t *p_date, uint32_t i_nb_
|
|
*/
|
|
uint64_t NTPtime64 (void)
|
|
{
|
|
-#if (_POSIX_TIMERS > 0)
|
|
+#if (_POSIX_TIMERS > 0) || defined(__OpenBSD__)
|
|
struct timespec ts;
|
|
|
|
clock_gettime (CLOCK_REALTIME, &ts);
|