blob: 853d68da4498e5b62c993a9789c7d550b743d459 [file] [log] [blame]
diff -aruN a/utils/start-stop-daemon.c b/utils/start-stop-daemon.c
--- a/utils/start-stop-daemon.c 2011-10-11 22:56:12.000000000 -0700
+++ b/utils/start-stop-daemon.c 2015-11-24 10:37:17.354279923 -0800
@@ -79,6 +79,7 @@
#include <sys/types.h>
#include <sys/time.h>
+#include <time.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <sys/termios.h>
@@ -288,8 +289,16 @@
static void
xgettimeofday(struct timeval *tv)
{
- if (gettimeofday(tv, NULL) != 0)
+ struct timespec tp;
+ if (clock_gettime(CLOCK_MONOTONIC, &tp))
fatal("gettimeofday failed");
+
+ /*
+ * Convert from timespec to timeval
+ * We do not care about microseconds, set to 0
+ */
+ tv->tv_sec = tp.tv_sec;
+ tv->tv_usec = 0;
}
static void
diff -aruN a/configure b/configure
--- a/configure 2011-10-13 22:09:45.000000000 -0700
+++ b/configure 2015-11-24 14:33:53.319638762 -0800
@@ -9350,6 +9350,46 @@
SSD_LIBS="${SSD_LIBS:+$SSD_LIBS }-lihash"
fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5
+$as_echo_n "checking for clock_gettime in -lrt... " >&6; }
+if ${ac_cv_lib_rt_clock_gettime+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lrt $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char clock_gettime ();
+int
+main ()
+{
+return clock_gettime ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_rt_clock_gettime=yes
+else
+ ac_cv_lib_rt_clock_gettime=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5
+$as_echo "$ac_cv_lib_rt_clock_gettime" >&6; }
+if test "x$ac_cv_lib_rt_clock_gettime" = xyes; then :
+ SSD_LIBS="${SSD_LIBS:+$SSD_LIBS }-lrt"
+fi
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for proc_stat_list_create in -lps" >&5
$as_echo_n "checking for proc_stat_list_create in -lps... " >&6; }
if ${ac_cv_lib_ps_proc_stat_list_create+:} false; then :