summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/syscalls/epoll.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-04-29 22:26:32 +0000
committergVisor bot <gvisor-bot@google.com>2021-04-29 22:26:32 +0000
commit8c0d3f7623b1b2a5c023db6a6f8c4e1e686cccb9 (patch)
tree976f7e4822f301edff453e8c18053a00dca1f59e /pkg/sentry/syscalls/epoll.go
parentec1bd0140355172742cb3365756faa129b3759c1 (diff)
parenteefa00f4aecc7c72a1866357fbd1bbb58aa6fc5e (diff)
Merge release-20210419.0-44-geefa00f4a (automated)
Diffstat (limited to 'pkg/sentry/syscalls/epoll.go')
-rw-r--r--pkg/sentry/syscalls/epoll.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/pkg/sentry/syscalls/epoll.go b/pkg/sentry/syscalls/epoll.go
index e115683f8..3b4d79889 100644
--- a/pkg/sentry/syscalls/epoll.go
+++ b/pkg/sentry/syscalls/epoll.go
@@ -119,7 +119,7 @@ func RemoveEpoll(t *kernel.Task, epfd int32, fd int32) error {
}
// WaitEpoll implements the epoll_wait(2) linux syscall.
-func WaitEpoll(t *kernel.Task, fd int32, max int, timeout int) ([]linux.EpollEvent, error) {
+func WaitEpoll(t *kernel.Task, fd int32, max int, timeoutInNanos int64) ([]linux.EpollEvent, error) {
// Get epoll from the file descriptor.
epollfile := t.GetFile(fd)
if epollfile == nil {
@@ -136,7 +136,7 @@ func WaitEpoll(t *kernel.Task, fd int32, max int, timeout int) ([]linux.EpollEve
// Try to read events and return right away if we got them or if the
// caller requested a non-blocking "wait".
r := e.ReadEvents(max)
- if len(r) != 0 || timeout == 0 {
+ if len(r) != 0 || timeoutInNanos == 0 {
return r, nil
}
@@ -144,8 +144,8 @@ func WaitEpoll(t *kernel.Task, fd int32, max int, timeout int) ([]linux.EpollEve
// and register with the epoll object for readability events.
var haveDeadline bool
var deadline ktime.Time
- if timeout > 0 {
- timeoutDur := time.Duration(timeout) * time.Millisecond
+ if timeoutInNanos > 0 {
+ timeoutDur := time.Duration(timeoutInNanos) * time.Nanosecond
deadline = t.Kernel().MonotonicClock().Now().Add(timeoutDur)
haveDeadline = true
}