diff options
Diffstat (limited to 'pkg/sentry/time')
-rw-r--r-- | pkg/sentry/time/sampler_unsafe.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/pkg/sentry/time/sampler_unsafe.go b/pkg/sentry/time/sampler_unsafe.go index e76180217..2ab57c5f8 100644 --- a/pkg/sentry/time/sampler_unsafe.go +++ b/pkg/sentry/time/sampler_unsafe.go @@ -15,8 +15,9 @@ package time import ( - "syscall" "unsafe" + + "golang.org/x/sys/unix" ) // syscallTSCReferenceClocks is the standard referenceClocks, collecting @@ -32,8 +33,8 @@ func (syscallTSCReferenceClocks) Sample(c ClockID) (sample, error) { s.before = Rdtsc() // Don't call clockGettime to avoid a call which may call morestack. - var ts syscall.Timespec - _, _, e := syscall.RawSyscall(syscall.SYS_CLOCK_GETTIME, uintptr(c), uintptr(unsafe.Pointer(&ts)), 0) + var ts unix.Timespec + _, _, e := unix.RawSyscall(unix.SYS_CLOCK_GETTIME, uintptr(c), uintptr(unsafe.Pointer(&ts)), 0) if e != 0 { return sample{}, e } @@ -46,8 +47,8 @@ func (syscallTSCReferenceClocks) Sample(c ClockID) (sample, error) { // clockGettime calls SYS_CLOCK_GETTIME, returning time in nanoseconds. func clockGettime(c ClockID) (ReferenceNS, error) { - var ts syscall.Timespec - _, _, e := syscall.RawSyscall(syscall.SYS_CLOCK_GETTIME, uintptr(c), uintptr(unsafe.Pointer(&ts)), 0) + var ts unix.Timespec + _, _, e := unix.RawSyscall(unix.SYS_CLOCK_GETTIME, uintptr(c), uintptr(unsafe.Pointer(&ts)), 0) if e != 0 { return 0, e } |