aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/tty_io.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2011-02-17 12:39:28 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2011-02-17 17:16:30 -0500
commit3c95c985fa91ecf6a0e29622bbdd13dcfc5ce9f1 (patch)
tree653ac54f667d5868712aef584ea7fea3b5542810 /drivers/tty/tty_io.c
parentafaae08442d86402f9e0b63475c02a651c6f1387 (diff)
tty: add TIOCVHANGUP to allow clean tty shutdown of all ttys
This is useful for system management software so that it can kick off things like gettys and everything that's started from a tty, before we reuse it from/for something else or shut it down. Without this ioctl it would have to temporarily become the owner of the tty, then call vhangup() and then give it up again. Cc: Lennart Poettering <lennart@poettering.net> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/tty/tty_io.c')
-rw-r--r--drivers/tty/tty_io.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 20a862a2a0c2..8ef2d69470ec 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -2626,6 +2626,11 @@ long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
2626 return put_user(tty->ldisc->ops->num, (int __user *)p); 2626 return put_user(tty->ldisc->ops->num, (int __user *)p);
2627 case TIOCSETD: 2627 case TIOCSETD:
2628 return tiocsetd(tty, p); 2628 return tiocsetd(tty, p);
2629 case TIOCVHANGUP:
2630 if (!capable(CAP_SYS_ADMIN))
2631 return -EPERM;
2632 tty_vhangup(tty);
2633 return 0;
2629 case TIOCGDEV: 2634 case TIOCGDEV:
2630 { 2635 {
2631 unsigned int ret = new_encode_dev(tty_devnum(real_tty)); 2636 unsigned int ret = new_encode_dev(tty_devnum(real_tty));