vfio: fix FreeBSD clear group stub
[dpdk.git] / lib / eal / freebsd / include / rte_os_shim.h
index 1e85229..862d4bf 100644 (file)
@@ -3,6 +3,8 @@
 #ifndef _RTE_OS_SHIM_
 #define _RTE_OS_SHIM_
 
+#include <time.h>
+
 #include <rte_os.h>
 
 /**
  * Provides semi-standard OS facilities by convenient names.
  */
 
+#ifndef TIME_UTC
+
+#define TIME_UTC 1
+
+static inline int
+rte_timespec_get(struct timespec *now, int base)
+{
+       if (base != TIME_UTC || clock_gettime(CLOCK_REALTIME, now) < 0)
+               return 0;
+       return base;
+}
+
+#define timespec_get(ts, base) rte_timespec_get(ts, base)
+
+#endif /* !defined TIME_UTC */
+
 #endif /* _RTE_OS_SHIM_ */