summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libc-test/build.rs8
-rw-r--r--libc-test/semver/freebsd.txt3
-rw-r--r--src/unix/bsd/freebsdlike/mod.rs3
3 files changed, 14 insertions, 0 deletions
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 26dbd99dea..3cab3ea70d 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -2082,6 +2082,14 @@ fn test_freebsd(target: &str) {
true
}
+ // These aliases were introduced in FreeBSD 13:
+ // (note however that the constants themselves work on any version)
+ "CLOCK_BOOTTIME" | "CLOCK_REALTIME_COARSE" | "CLOCK_MONOTONIC_COARSE"
+ if Some(13) > freebsd_ver =>
+ {
+ true
+ }
+
// FIXME: These are deprecated - remove in a couple of releases.
// These constants were removed in FreeBSD 11 (svn r273250) but will
// still be accepted and ignored at runtime.
diff --git a/libc-test/semver/freebsd.txt b/libc-test/semver/freebsd.txt
index ba0a3c1fd6..429ae63eb8 100644
--- a/libc-test/semver/freebsd.txt
+++ b/libc-test/semver/freebsd.txt
@@ -149,10 +149,13 @@ CLD_EXITED
CLD_KILLED
CLD_STOPPED
CLD_TRAPPED
+CLOCK_BOOTTIME
+CLOCK_MONOTONIC_COARSE
CLOCK_MONOTONIC_FAST
CLOCK_MONOTONIC_PRECISE
CLOCK_PROCESS_CPUTIME_ID
CLOCK_PROF
+CLOCK_REALTIME_COARSE
CLOCK_REALTIME_FAST
CLOCK_REALTIME_PRECISE
CLOCK_SECOND
diff --git a/src/unix/bsd/freebsdlike/mod.rs b/src/unix/bsd/freebsdlike/mod.rs
index 9aefb36e4e..6a0f383bc0 100644
--- a/src/unix/bsd/freebsdlike/mod.rs
+++ b/src/unix/bsd/freebsdlike/mod.rs
@@ -824,12 +824,15 @@ pub const CLOCK_VIRTUAL: ::clockid_t = 1;
pub const CLOCK_PROF: ::clockid_t = 2;
pub const CLOCK_MONOTONIC: ::clockid_t = 4;
pub const CLOCK_UPTIME: ::clockid_t = 5;
+pub const CLOCK_BOOTTIME: ::clockid_t = CLOCK_UPTIME;
pub const CLOCK_UPTIME_PRECISE: ::clockid_t = 7;
pub const CLOCK_UPTIME_FAST: ::clockid_t = 8;
pub const CLOCK_REALTIME_PRECISE: ::clockid_t = 9;
pub const CLOCK_REALTIME_FAST: ::clockid_t = 10;
+pub const CLOCK_REALTIME_COARSE: ::clockid_t = CLOCK_REALTIME_FAST;
pub const CLOCK_MONOTONIC_PRECISE: ::clockid_t = 11;
pub const CLOCK_MONOTONIC_FAST: ::clockid_t = 12;
+pub const CLOCK_MONOTONIC_COARSE: ::clockid_t = CLOCK_MONOTONIC_FAST;
pub const CLOCK_SECOND: ::clockid_t = 13;
pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 14;
pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 15;