summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fsimpl/devpts/queue.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-09-01 20:05:51 +0000
committergVisor bot <gvisor-bot@google.com>2020-09-01 20:05:51 +0000
commit326119398a23ecb6fef8b162fc358420239bf2c5 (patch)
tree13b4b0a491b684e88ddc63294f66ccd31d44c04d /pkg/sentry/fsimpl/devpts/queue.go
parentf5181c6067ad420d16557d21734453994fb42791 (diff)
parent723fb5c1164872fd1de418d794aa1e9eced8fd94 (diff)
Merge release-20200818.0-100-g723fb5c11 (automated)
Diffstat (limited to 'pkg/sentry/fsimpl/devpts/queue.go')
-rw-r--r--pkg/sentry/fsimpl/devpts/queue.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/pkg/sentry/fsimpl/devpts/queue.go b/pkg/sentry/fsimpl/devpts/queue.go
index 331c13997..08eca2589 100644
--- a/pkg/sentry/fsimpl/devpts/queue.go
+++ b/pkg/sentry/fsimpl/devpts/queue.go
@@ -19,10 +19,12 @@ import (
"gvisor.dev/gvisor/pkg/context"
"gvisor.dev/gvisor/pkg/safemem"
"gvisor.dev/gvisor/pkg/sentry/arch"
+ "gvisor.dev/gvisor/pkg/sentry/kernel"
"gvisor.dev/gvisor/pkg/sync"
"gvisor.dev/gvisor/pkg/syserror"
"gvisor.dev/gvisor/pkg/usermem"
"gvisor.dev/gvisor/pkg/waiter"
+ "gvisor.dev/gvisor/tools/go_marshal/primitive"
)
// waitBufMaxBytes is the maximum size of a wait buffer. It is based on
@@ -83,17 +85,15 @@ func (q *queue) writeReadiness(t *linux.KernelTermios) waiter.EventMask {
}
// readableSize writes the number of readable bytes to userspace.
-func (q *queue) readableSize(ctx context.Context, io usermem.IO, args arch.SyscallArguments) error {
+func (q *queue) readableSize(t *kernel.Task, io usermem.IO, args arch.SyscallArguments) error {
q.mu.Lock()
defer q.mu.Unlock()
- var size int32
+ size := primitive.Int32(0)
if q.readable {
- size = int32(len(q.readBuf))
+ size = primitive.Int32(len(q.readBuf))
}
- _, err := usermem.CopyObjectOut(ctx, io, args[2].Pointer(), size, usermem.IOOpts{
- AddressSpaceActive: true,
- })
+ _, err := size.CopyOut(t, args[2].Pointer())
return err
}