summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/kernel/pipe/node_test.go
diff options
context:
space:
mode:
authorAndrei Vagin <avagin@google.com>2019-05-23 23:20:11 -0700
committerShentubot <shentubot@google.com>2019-05-23 23:21:13 -0700
commita949133c4b22a87c79310b2d825f2899028d6088 (patch)
tree439e03ccfff0c8bfe64cdef3e5191d39015b957c /pkg/sentry/kernel/pipe/node_test.go
parent409e8eea60f096b34c9005b302dc821f38ac19ed (diff)
gvisor: interrupt the sendfile system call if a task has been interrupted
sendfile can be called for a big range and it can require significant amount of time to process it, so we need to handle task interrupts in this system call. PiperOrigin-RevId: 249781023 Change-Id: Ifc2ec505d74c06f5ee76f93b8d30d518ec2d4015
Diffstat (limited to 'pkg/sentry/kernel/pipe/node_test.go')
-rw-r--r--pkg/sentry/kernel/pipe/node_test.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/pkg/sentry/kernel/pipe/node_test.go b/pkg/sentry/kernel/pipe/node_test.go
index 7ddecdad8..31d9b0443 100644
--- a/pkg/sentry/kernel/pipe/node_test.go
+++ b/pkg/sentry/kernel/pipe/node_test.go
@@ -48,6 +48,10 @@ func (s *sleeper) Cancel() {
s.ch <- struct{}{}
}
+func (s *sleeper) Interrupted() bool {
+ return len(s.ch) != 0
+}
+
type openResult struct {
*fs.File
error