summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fs/tty/slave.go
diff options
context:
space:
mode:
authorKevin Krakauer <krakauer@google.com>2018-05-11 17:18:56 -0700
committerShentubot <shentubot@google.com>2018-05-11 17:19:46 -0700
commit08879266fef3a67fac1a77f1ea133c3ac75759dd (patch)
treefc5abd338ca53845e2b0d55f129586bd5d333c42 /pkg/sentry/fs/tty/slave.go
parent987f7841a6ad8b77fe6a41cb70323517a5d2ccd1 (diff)
sentry: Adds canonical mode support.
PiperOrigin-RevId: 196331627 Change-Id: Ifef4485f8202c52481af317cedd52d2ef48cea6a
Diffstat (limited to 'pkg/sentry/fs/tty/slave.go')
-rw-r--r--pkg/sentry/fs/tty/slave.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/pkg/sentry/fs/tty/slave.go b/pkg/sentry/fs/tty/slave.go
index 9178071a4..f5eec726e 100644
--- a/pkg/sentry/fs/tty/slave.go
+++ b/pkg/sentry/fs/tty/slave.go
@@ -133,6 +133,9 @@ func (sf *slaveFileOperations) Write(ctx context.Context, _ *fs.File, src userme
// Ioctl implements fs.FileOperations.Ioctl.
func (sf *slaveFileOperations) Ioctl(ctx context.Context, io usermem.IO, args arch.SyscallArguments) (uintptr, error) {
switch args[1].Uint() {
+ case linux.FIONREAD: // linux.FIONREAD == linux.TIOCINQ
+ // Get the number of bytes in the input queue read buffer.
+ return 0, sf.si.t.ld.inputQueueReadSize(ctx, io, args)
case linux.TCGETS:
return sf.si.t.ld.getTermios(ctx, io, args)
case linux.TCSETS: