From 35719d52c7ac7faa87b610013aedd69ad5d99ecc Mon Sep 17 00:00:00 2001 From: Nicolas Lacasse Date: Sat, 22 Jun 2019 13:28:21 -0700 Subject: Implement statx. We don't have the plumbing for btime yet, so that field is left off. The returned mask indicates that btime is absent. Fixes #343 PiperOrigin-RevId: 254575752 --- pkg/sentry/kernel/time/time.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'pkg/sentry/kernel/time') 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) { -- cgit v1.2.3