diff options
| author | gnzlbg <gonzalobg88@gmail.com> | 2019-05-31 13:50:30 +0200 |
|---|---|---|
| committer | gnzlbg <gonzalobg88@gmail.com> | 2019-08-01 17:01:33 +0200 |
| commit | 9ea83f9732d7a15467bed88d4a996487713c70d4 (patch) | |
| tree | fdaab0409c46af0fce7d76aa81b6fe62281f03ed /src/libstd/sys/unix/time.rs | |
| parent | a17951c4f80eb5208030f91fdb4ae93919fa6b12 (diff) | |
| download | rust-9ea83f9732d7a15467bed88d4a996487713c70d4.tar.gz rust-9ea83f9732d7a15467bed88d4a996487713c70d4.zip | |
Update libc and use the Mach kernel APIs via the mach crate instead.
Diffstat (limited to 'src/libstd/sys/unix/time.rs')
| -rw-r--r-- | src/libstd/sys/unix/time.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libstd/sys/unix/time.rs b/src/libstd/sys/unix/time.rs index e21c32cd91b..b7d2c4562f7 100644 --- a/src/libstd/sys/unix/time.rs +++ b/src/libstd/sys/unix/time.rs @@ -139,7 +139,7 @@ mod inner { impl Instant { pub fn now() -> Instant { - Instant { t: unsafe { libc::mach_absolute_time() } } + Instant { t: unsafe { mach::mach_time::mach_absolute_time() } } } pub const fn zero() -> Instant { @@ -230,8 +230,9 @@ mod inner { Some(mul_div_u64(nanos, info.denom as u64, info.numer as u64)) } - fn info() -> libc::mach_timebase_info { - static mut INFO: libc::mach_timebase_info = libc::mach_timebase_info { + fn info() -> mach::mach_time::mach_timebase_info { + static mut INFO: mach::mach_time::mach_timebase_info + = mach::mach_time::mach_timebase_info { numer: 0, denom: 0, }; @@ -245,7 +246,7 @@ mod inner { // ... otherwise learn for ourselves ... let mut info = mem::zeroed(); - libc::mach_timebase_info(&mut info); + mach::mach_time::mach_timebase_info(&mut info); // ... and attempt to be the one thread that stores it globally for // all other threads |
