Skip to content

Commit 257411b

Browse files
xtqqczzeSteveLauC
authored andcommitted
time: Add netbsdlike support for several ClockID constants
1 parent 962d80c commit 257411b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/time.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ impl ClockId {
6060
linux_android,
6161
target_os = "emscripten",
6262
target_os = "freebsd",
63-
target_os = "fuchsia"
63+
target_os = "fuchsia",
64+
target_os = "openbsd",
6465
))]
6566
/// Starts at zero when the kernel boots and increments monotonically in SI seconds while the
6667
/// machine is running.
@@ -97,6 +98,7 @@ impl ClockId {
9798
linux_android,
9899
apple_targets,
99100
freebsdlike,
101+
netbsdlike,
100102
target_os = "emscripten",
101103
target_os = "fuchsia",
102104
target_os = "redox",
@@ -152,13 +154,14 @@ impl ClockId {
152154
linux_android,
153155
apple_targets,
154156
freebsdlike,
157+
netbsdlike,
155158
target_os = "emscripten",
156159
target_os = "fuchsia",
157160
))]
158161
/// Returns the execution time of the calling thread.
159162
pub const CLOCK_THREAD_CPUTIME_ID: ClockId =
160163
ClockId(libc::CLOCK_THREAD_CPUTIME_ID);
161-
#[cfg(freebsdlike)]
164+
#[cfg(any(freebsdlike, target_os = "openbsd"))]
162165
/// Starts at zero when the kernel boots and increments monotonically in SI seconds while the
163166
/// machine is running.
164167
pub const CLOCK_UPTIME: ClockId = ClockId(libc::CLOCK_UPTIME);

0 commit comments

Comments
 (0)