summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fs/tty/queue.go
diff options
context:
space:
mode:
authorAyush Ranjan <ayushranjan@google.com>2020-09-01 12:59:49 -0700
committergVisor bot <gvisor-bot@google.com>2020-09-01 13:02:17 -0700
commit723fb5c1164872fd1de418d794aa1e9eced8fd94 (patch)
treeb929efbeb59b48afd5324713baf7bd8a62f83ea0 /pkg/sentry/fs/tty/queue.go
parent71589b7f7e69b85820c9deb75fc6d0b6c5f00eb1 (diff)
[go-marshal] Enable auto-marshalling for fs/tty.
PiperOrigin-RevId: 329564614
Diffstat (limited to 'pkg/sentry/fs/tty/queue.go')
-rw-r--r--pkg/sentry/fs/tty/queue.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/pkg/sentry/fs/tty/queue.go b/pkg/sentry/fs/tty/queue.go
index c5d7ec717..f0a18c75a 100644
--- a/pkg/sentry/fs/tty/queue.go
+++ b/pkg/sentry/fs/tty/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"
)
// LINT.IfChange
@@ -85,17 +87,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, 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
}