summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/kernel/time
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2019-06-22 20:37:41 +0000
committergVisor bot <gvisor-bot@google.com>2019-06-22 20:37:41 +0000
commitd01228b4707699238b93057065748e9391113358 (patch)
tree308e3df7de9d4d76d349daf8444e0e7d54e77b7b /pkg/sentry/kernel/time
parenta09dced0e1e48d31dea8b5b5d7b6b52269b6adcc (diff)
parent35719d52c7ac7faa87b610013aedd69ad5d99ecc (diff)
Merge 35719d52 (automated)
Diffstat (limited to 'pkg/sentry/kernel/time')
-rw-r--r--pkg/sentry/kernel/time/time.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/sentry/kernel/time/time.go b/pkg/sentry/kernel/time/time.go
index 9c3c05239..aa6c75d25 100644
--- a/pkg/sentry/kernel/time/time.go
+++ b/pkg/sentry/kernel/time/time.go
@@ -142,6 +142,11 @@ func (t Time) Timeval() linux.Timeval {
return linux.NsecToTimeval(t.Nanoseconds())
}
+// StatxTimestamp converts Time to a Linux statx_timestamp.
+func (t Time) StatxTimestamp() linux.StatxTimestamp {
+ return linux.NsecToStatxTimestamp(t.Nanoseconds())
+}
+
// Add adds the duration of d to t.
func (t Time) Add(d time.Duration) Time {
if t.ns > 0 && d.Nanoseconds() > math.MaxInt64-int64(t.ns) {