#include "util/u_atomic.h"
#if defined(PIPE_OS_UNIX)
+# include <unistd.h> /* usleep */
# include <time.h> /* timeval */
# include <sys/time.h> /* timeval */
# include <sched.h> /* sched_yield */
int64_t
os_time_get_nano(void)
{
-#if defined(PIPE_OS_LINUX)
+#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD)
struct timespec tv;
clock_gettime(CLOCK_MONOTONIC, &tv);