summaryrefslogtreecommitdiffhomepage
path: root/pkg
diff options
context:
space:
mode:
authorNicolas Lacasse <nlacasse@google.com>2018-10-03 17:28:52 -0700
committerShentubot <shentubot@google.com>2018-10-03 17:29:56 -0700
commit213f6688a56e7bcd1205c77dc79c3e5cfee817fe (patch)
tree2be09b2bc85ef272f6f303a6bd4ba0542341f7f7 /pkg
parent4fef31f96c289d5e58c3c2997ee38fcb22c0378f (diff)
Implement TIOCSCTTY ioctl as a noop.
PiperOrigin-RevId: 215658757 Change-Id: If63b33293f3e53a7f607ae72daa79e2b7ef6fcfd
Diffstat (limited to 'pkg')
-rw-r--r--pkg/abi/linux/ioctl.go1
-rw-r--r--pkg/sentry/fs/tty/slave.go6
2 files changed, 7 insertions, 0 deletions
diff --git a/pkg/abi/linux/ioctl.go b/pkg/abi/linux/ioctl.go
index 1c9dc7b03..afd9ee82b 100644
--- a/pkg/abi/linux/ioctl.go
+++ b/pkg/abi/linux/ioctl.go
@@ -22,6 +22,7 @@ const (
TCSETS = 0x00005402
TCSETSW = 0x00005403
TCSETSF = 0x00005404
+ TIOCSCTTY = 0x0000540e
TIOCGPGRP = 0x0000540f
TIOCSPGRP = 0x00005410
TIOCOUTQ = 0x00005411
diff --git a/pkg/sentry/fs/tty/slave.go b/pkg/sentry/fs/tty/slave.go
index 963331b9b..4a0d4fdb9 100644
--- a/pkg/sentry/fs/tty/slave.go
+++ b/pkg/sentry/fs/tty/slave.go
@@ -154,6 +154,12 @@ func (sf *slaveFileOperations) Ioctl(ctx context.Context, io usermem.IO, args ar
return 0, sf.si.t.ld.windowSize(ctx, io, args)
case linux.TIOCSWINSZ:
return 0, sf.si.t.ld.setWindowSize(ctx, io, args)
+ case linux.TIOCSCTTY:
+ // Make the given terminal the controlling terminal of the
+ // calling process.
+ // TODO: Implement once we have support for job
+ // control.
+ return 0, nil
default:
return 0, syserror.ENOTTY
}