Skip to content

Commit

Permalink
Remove declarations of non-existing clock_ids
Browse files Browse the repository at this point in the history
  • Loading branch information
Meziu committed Jan 31, 2022
1 parent 1e88291 commit 8744910
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/unix/newlib/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,8 +449,16 @@ pub const AF_UNSPEC: ::c_int = 0;
pub const AF_INET: ::c_int = 2;

pub const CLOCK_REALTIME: ::clockid_t = 1;
pub const CLOCK_MONOTONIC: ::clockid_t = 4;
pub const CLOCK_BOOTTIME: ::clockid_t = 4;
cfg_if! {
if #[cfg(target_os = "horizon")] {
// There is only one clock in HorizonOS, based on the system local time
pub const CLOCK_MONOTONIC: ::clockid_t = 1;
pub const CLOCK_BOOTTIME: ::clockid_t = 1;
} else {
pub const CLOCK_MONOTONIC: ::clockid_t = 4;
pub const CLOCK_BOOTTIME: ::clockid_t = 4;
}
}

pub const SOCK_STREAM: ::c_int = 1;
pub const SOCK_DGRAM: ::c_int = 2;
Expand Down

0 comments on commit 8744910

Please sign in to comment.