diff options
| author | Josh Stone <jistone@redhat.com> | 2022-03-09 17:05:16 -0800 |
|---|---|---|
| committer | Josh Stone <jistone@redhat.com> | 2022-05-06 08:50:53 -0700 |
| commit | fec4818fdb40c82679f57fa7f26fcddc1a874c13 (patch) | |
| tree | 4c06a6e5b385e327257f7f7fe8f8746f422622d1 /library/std/src/sys/unix/time.rs | |
| parent | 97b49a0cc5bea5845dc89c1598a32d7f9fea985a (diff) | |
| download | rust-fec4818fdb40c82679f57fa7f26fcddc1a874c13.tar.gz rust-fec4818fdb40c82679f57fa7f26fcddc1a874c13.zip | |
Use statx's 64-bit times on 32-bit linux-gnu
Diffstat (limited to 'library/std/src/sys/unix/time.rs')
| -rw-r--r-- | library/std/src/sys/unix/time.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/library/std/src/sys/unix/time.rs b/library/std/src/sys/unix/time.rs index 20d061206be..5000e7d890b 100644 --- a/library/std/src/sys/unix/time.rs +++ b/library/std/src/sys/unix/time.rs @@ -144,6 +144,10 @@ mod inner { } impl SystemTime { + pub fn new(tv_sec: i64, tv_nsec: i64) -> SystemTime { + SystemTime { t: Timespec::new(tv_sec, tv_nsec) } + } + pub fn now() -> SystemTime { use crate::ptr; @@ -294,6 +298,10 @@ mod inner { } impl SystemTime { + pub fn new(tv_sec: i64, tv_nsec: i64) -> SystemTime { + SystemTime { t: Timespec::new(tv_sec, tv_nsec) } + } + pub fn now() -> SystemTime { SystemTime { t: Timespec::now(libc::CLOCK_REALTIME) } } |
