diff options
| author | Cameron <51241057+maniwani@users.noreply.github.com> | 2022-11-13 12:33:21 -0800 |
|---|---|---|
| committer | Cameron <51241057+maniwani@users.noreply.github.com> | 2022-11-13 12:33:21 -0800 |
| commit | 015ab659c2fcdf2f3a3fdaa6dc44455b9d0c2f3e (patch) | |
| tree | f3a1c8d5b0157fd3165abd81068f66d6e7ee93d9 /library/std/src/sys | |
| parent | 5008a317ce8e508c390ed12bff281f307313376e (diff) | |
| download | rust-015ab659c2fcdf2f3a3fdaa6dc44455b9d0c2f3e.tar.gz rust-015ab659c2fcdf2f3a3fdaa6dc44455b9d0c2f3e.zip | |
just use `libc::clockid_t`
Diffstat (limited to 'library/std/src/sys')
| -rw-r--r-- | library/std/src/sys/unix/time.rs | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/library/std/src/sys/unix/time.rs b/library/std/src/sys/unix/time.rs index b65566740b5..c3fac44a42d 100644 --- a/library/std/src/sys/unix/time.rs +++ b/library/std/src/sys/unix/time.rs @@ -290,9 +290,9 @@ mod inner { impl Instant { pub fn now() -> Instant { #[cfg(target_os = "macos")] - const clock_id: clock_t = libc::CLOCK_UPTIME_RAW; + const clock_id: libc::clockid_t = libc::CLOCK_UPTIME_RAW; #[cfg(not(target_os = "macos"))] - const clock_id: clock_t = libc::CLOCK_MONOTONIC; + const clock_id: libc::clockid_t = libc::CLOCK_MONOTONIC; Instant { t: Timespec::now(clock_id) } } @@ -324,13 +324,8 @@ mod inner { } } - #[cfg(not(any(target_os = "dragonfly", target_os = "espidf", target_os = "horizon")))] - pub type clock_t = libc::c_int; - #[cfg(any(target_os = "dragonfly", target_os = "espidf", target_os = "horizon"))] - pub type clock_t = libc::c_ulong; - impl Timespec { - pub fn now(clock: clock_t) -> Timespec { + pub fn now(clock: libc::clockid_t) -> Timespec { // Try to use 64-bit time in preparation for Y2038. #[cfg(all(target_os = "linux", target_env = "gnu", target_pointer_width = "32"))] { |
