Skip to content

Commit d55e299

Browse files
committed
Add typedef for clock_id
1 parent 88f0c0d commit d55e299

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

library/std/src/sys/unix/time.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,14 @@ mod inner {
146146
type mach_timebase_info_t = *mut mach_timebase_info;
147147
type kern_return_t = libc::c_int;
148148

149+
pub type clockid_t = libc::clockid_t;
150+
149151
impl Instant {
150152
pub fn now() -> Instant {
151153
extern "C" {
152-
fn clock_gettime_nsec_np(clock_type: u32) -> u64;
154+
fn clock_gettime_nsec_np(clock_id: clockid_t) -> u64;
153155
}
154-
Instant { t: unsafe { clock_gettime_nsec_np(4) } }
156+
Instant { t: unsafe { clock_gettime_nsec_np(8) } }
155157
}
156158

157159
pub fn checked_sub_instant(&self, other: &Instant) -> Option<Duration> {

0 commit comments

Comments
 (0)