From 995502a494b3ca17e1d319ea5b311c166f772400 Mon Sep 17 00:00:00 2001 From: Leonardo Taccari Date: Tue, 2 Jan 2024 18:37:30 +0100 Subject: [PATCH] Add support for NetBSD NetBSD does not have any CLOCK_BOOTTIME. --- boringtun/src/sleepyinstant/unix.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/boringtun/src/sleepyinstant/unix.rs b/boringtun/src/sleepyinstant/unix.rs index 8488c2f4..52f2db4d 100644 --- a/boringtun/src/sleepyinstant/unix.rs +++ b/boringtun/src/sleepyinstant/unix.rs @@ -3,9 +3,9 @@ use std::time::Duration; use nix::sys::time::TimeSpec; use nix::time::{clock_gettime, ClockId}; -#[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos"))] +#[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos", target_os = "netbsd"))] const CLOCK_ID: ClockId = ClockId::CLOCK_MONOTONIC; -#[cfg(not(any(target_os = "macos", target_os = "ios", target_os = "tvos")))] +#[cfg(not(any(target_os = "macos", target_os = "ios", target_os = "tvos", target_os = "netbsd")))] const CLOCK_ID: ClockId = ClockId::CLOCK_BOOTTIME; #[derive(Clone, Copy, Debug)]