diff options
author | gVisor bot <gvisor-bot@google.com> | 2019-06-22 20:37:41 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2019-06-22 20:37:41 +0000 |
commit | d01228b4707699238b93057065748e9391113358 (patch) | |
tree | 308e3df7de9d4d76d349daf8444e0e7d54e77b7b /pkg/abi/linux/time.go | |
parent | a09dced0e1e48d31dea8b5b5d7b6b52269b6adcc (diff) | |
parent | 35719d52c7ac7faa87b610013aedd69ad5d99ecc (diff) |
Merge 35719d52 (automated)
Diffstat (limited to 'pkg/abi/linux/time.go')
-rw-r--r-- | pkg/abi/linux/time.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/pkg/abi/linux/time.go b/pkg/abi/linux/time.go index fa9ee27e1..e727066d7 100644 --- a/pkg/abi/linux/time.go +++ b/pkg/abi/linux/time.go @@ -226,3 +226,18 @@ type Tms struct { // TimerID represents type timer_t, which identifies a POSIX per-process // interval timer. type TimerID int32 + +// StatxTimestamp represents struct statx_timestamp. +type StatxTimestamp struct { + Sec int64 + Nsec uint32 + _ int32 +} + +// NsecToStatxTimestamp translates nanoseconds to StatxTimestamp. +func NsecToStatxTimestamp(nsec int64) (ts StatxTimestamp) { + return StatxTimestamp{ + Sec: nsec / 1e9, + Nsec: uint32(nsec % 1e9), + } +} |