]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] add vt console scrollback ioctl
authorAndrew Morton <akpm@digeo.com>
Thu, 3 Apr 2003 00:28:18 +0000 (16:28 -0800)
committerLinus Torvalds <torvalds@home.transmeta.com>
Thu, 3 Apr 2003 00:28:18 +0000 (16:28 -0800)
From: Samuel Thibault <Samuel.Thibault@ens-lyon.fr>

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

index 5933c8ddb8f8cdfb5c72f89a7479b7e30d0d77e7..cb7f1ccd1b87e532d0362fe6762dd92b59426ddb 100644 (file)
@@ -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;