patch-1.3.43 linux/drivers/char/tty_io.c
Next file: linux/drivers/char/vga.c
Previous file: linux/drivers/char/tpqic02.c
Back to the patch index
Back to the overall index
-  Lines: 44
 -  Date:
Tue Nov 21 08:34:54 1995
 -  Orig file: 
v1.3.42/linux/drivers/char/tty_io.c
 -  Orig date: 
Thu Nov  9 11:23:49 1995
 
diff -u --recursive --new-file v1.3.42/linux/drivers/char/tty_io.c linux/drivers/char/tty_io.c
@@ -38,6 +38,9 @@
  *
  * Reorganized FASYNC support so mouse code can share it.
  *	-- ctm@ardi.com, 9Sep95
+ *
+ * New TIOCLINUX variants added.
+ *	-- mj@k332.feld.cvut.cz, 19-Nov-95
  */
 
 #include <linux/config.h>
@@ -84,12 +87,14 @@
 
 /*
  * fg_console is the current virtual console,
- * last_console is the last used one
+ * last_console is the last used one,
+ * kmsg_redirect is the console for kernel messages,
  * redirect is the pseudo-tty that console output
  * is redirected to if asked by TIOCCONS.
  */
 int fg_console = 0;
 int last_console = 0;
+int kmsg_redirect = 0;
 struct tty_struct * redirect = NULL;
 struct wait_queue * keypress_wait = NULL;
 
@@ -1542,6 +1547,17 @@
 				case 10:
 					set_vesa_blanking(arg);
 					return 0;
+				case 11:	/* set kmsg redirect */
+					if (!suser())
+						return -EPERM;
+					retval = verify_area(VERIFY_READ,
+						(void *) arg+1, 1);
+					if (retval)
+						return retval;
+					kmsg_redirect = get_user((char *)arg+1);
+					return 0;
+				case 12:	/* get fg_console */
+					return fg_console;
 				default: 
 					return -EINVAL;
 			}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov
with Sam's (original) version of this