Skip to content

Commit 76b2692

Browse files
committed
Add note about ignoring a1 in gettimeofday
1 parent ea0150f commit 76b2692

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎rules/time/tgt_refcount.rs‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ fn f7(a0: Ptr<u8>, a1: Ptr<Timeval>) -> i32 {
107107
}
108108
}
109109

110+
// a1 is ignored intentionally, see: https://man7.org/linux/man-pages/man2/gettimeofday.2.html
111+
//
112+
// "The use of the timezone structure is obsolete; the tz argument should normally be specified as NULL."
110113
#[cfg(target_os = "linux")]
111114
fn f8(a0: Ptr<Timeval>, a1: Ptr<::libc::timezone>) -> i32 {
112115
match nix::time::clock_gettime(nix::time::ClockId::CLOCK_REALTIME) {
@@ -124,6 +127,9 @@ fn f8(a0: Ptr<Timeval>, a1: Ptr<::libc::timezone>) -> i32 {
124127
}
125128
}
126129

130+
// a1 is ignored intentionally, see: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/gettimeofday.2.html
131+
//
132+
// "Note: timezone is no longer used; this information is kept outside the kernel."
127133
#[cfg(target_os = "macos")]
128134
fn f8(a0: Ptr<Timeval>, a1: AnyPtr) -> i32 {
129135
match nix::time::clock_gettime(nix::time::ClockId::CLOCK_REALTIME) {

0 commit comments

Comments
 (0)