From b7b8de087384cc1954a8cd075af3f9e5977caa2e Mon Sep 17 00:00:00 2001 From: Werner Fink Date: Fri, 3 Dec 2010 12:48:23 +0100 Subject: TTY: Add tty ioctl to figure device node of the system console. This has been in the SuSE kernels for a very long time. Signed-off-by: Werner Fink Signed-off-by: Greg Kroah-Hartman --- drivers/tty/tty_io.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'drivers/tty') diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index be5ab4a..d2333ab 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c @@ -2618,6 +2618,11 @@ long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg) return put_user(tty->ldisc->ops->num, (int __user *)p); case TIOCSETD: return tiocsetd(tty, p); + case TIOCGDEV: + { + unsigned int ret = new_encode_dev(tty_devnum(real_tty)); + return put_user(ret, (unsigned int __user *)p); + } /* * Break handling */ -- cgit v1.1