summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fs/tty/master.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/master.go
parent987f7841a6ad8b77fe6a41cb70323517a5d2ccd1 (diff)
sentry: Adds canonical mode support.
PiperOrigin-RevId: 196331627 Change-Id: Ifef4485f8202c52481af317cedd52d2ef48cea6a
Diffstat (limited to 'pkg/sentry/fs/tty/master.go')
-rw-r--r--pkg/sentry/fs/tty/master.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/pkg/sentry/fs/tty/master.go b/pkg/sentry/fs/tty/master.go
index 3c47ee517..74cdbe874 100644
--- a/pkg/sentry/fs/tty/master.go
+++ b/pkg/sentry/fs/tty/master.go
@@ -148,6 +148,9 @@ func (mf *masterFileOperations) Write(ctx context.Context, _ *fs.File, src userm
// Ioctl implements fs.FileOperations.Ioctl.
func (mf *masterFileOperations) 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 output queue read buffer.
+ return 0, mf.t.ld.outputQueueReadSize(ctx, io, args)
case linux.TCGETS:
// N.B. TCGETS on the master actually returns the configuration
// of the slave end.