1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//! The reader's UTC offset on Unix, from libc.
//!
//! Rust's standard library has no local time, deliberately: resolving one needs
//! a timezone database, and the C function that reads the system's has a
//! documented race. podup already depends on `libc` and already carries FFI in
//! five other modules, so this is that pattern rather than a new dependency or
//! an in-tree tzfile parser.
// libc FFI (localtime_r) is needed here; the block carries a soundness comment.
/// Offset from UTC in seconds at `unix_secs`, or `None` when libc refuses.
///
/// Resolved per instant rather than once, so an instant on the far side of a
/// daylight-saving transition gets the offset that applied then.
pub