Skip to content

Commit 9cfdb15

Browse files
authored
Add rules for CLOCK_MONOTONIC constants (#274)
1 parent 29af8cd commit 9cfdb15

3 files changed

Lines changed: 24 additions & 0 deletions

File tree

‎rules/time/src.c‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,9 @@ int f8(struct timeval *tv, void *tz) {
4545
clockid_t f9() {
4646
return CLOCK_REALTIME;
4747
}
48+
49+
clockid_t f10() { return CLOCK_MONOTONIC; }
50+
51+
#ifdef __linux__
52+
clockid_t f11() { return CLOCK_MONOTONIC_RAW; }
53+
#endif

‎rules/time/tgt_refcount.rs‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,3 +170,12 @@ fn f8(a0: Ptr<Timeval>, a1: AnyPtr) -> i32 {
170170
unsafe fn f9() -> nix::time::ClockId {
171171
nix::time::ClockId::CLOCK_REALTIME
172172
}
173+
174+
unsafe fn f10() -> nix::time::ClockId {
175+
nix::time::ClockId::CLOCK_MONOTONIC
176+
}
177+
178+
#[cfg(target_os = "linux")]
179+
unsafe fn f11() -> nix::time::ClockId {
180+
nix::time::ClockId::CLOCK_MONOTONIC_RAW
181+
}

‎rules/time/tgt_unsafe.rs‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,12 @@ unsafe fn f8(a0: *mut libc::timeval, a1: *mut libc::c_void) -> i32 {
5555
unsafe fn f9() -> libc::clockid_t {
5656
libc::CLOCK_REALTIME
5757
}
58+
59+
unsafe fn f10() -> libc::clockid_t {
60+
libc::CLOCK_MONOTONIC
61+
}
62+
63+
#[cfg(target_os = "linux")]
64+
unsafe fn f11() -> libc::clockid_t {
65+
libc::CLOCK_MONOTONIC_RAW
66+
}

0 commit comments

Comments
 (0)