From 8a8e9c880a859ecdce3b7016b69c1d149c2e9c08 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Wed, 2 Apr 2003 16:28:18 -0800 Subject: [PATCH] [PATCH] add vt console scrollback ioctl From: Samuel Thibault There is no way for a braille device driven by brltty (userland root-owned daemon) to scrollback the virtual console, the only way is to use the pc keyboard. A very simple TIOCLINUX ioctl meets this need (tested). Also add a command for bringing the last console to the top, as keyboard.c's lastcons() does when pressing alt - down arrow. --- drivers/char/vt.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/char/vt.c b/drivers/char/vt.c index 5933c8ddb8f8c..cb7f1ccd1b87e 100644 --- a/drivers/char/vt.c +++ b/drivers/char/vt.c @@ -1313,6 +1313,9 @@ static void setterm_command(int currcons) case 14: /* set vesa powerdown interval */ vesa_off_interval = ((par[1] < 60) ? par[1] : 60) * 60 * HZ; break; + case 15: /* Activate the previous console */ + set_console(last_console); + break; } } @@ -2210,6 +2213,7 @@ struct console vt_console_driver = { int tioclinux(struct tty_struct *tty, unsigned long arg) { char type, data; + int lines; int ret; if (tty->driver.type != TTY_DRIVER_TYPE_CONSOLE) @@ -2266,6 +2270,14 @@ int tioclinux(struct tty_struct *tty, unsigned long arg) case 12: /* get fg_console */ ret = fg_console; break; + case 13: /* scroll console */ + if (get_user(lines, (char *)arg+1)) { + ret = -EFAULT; + } else { + scrollfront(lines); + ret = 0; + } + break; default: ret = -EINVAL; break; -- 2.53.0