Skip to contentSkip to conversation

vt: add TIOCL_GETKMSGREDIRECT

PATCH In review Rafael J. Wysocki 2 participants 2 messages Mar 30, 2006 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vt: add TIOCL_GETKMSGREDIRECT

Add TIOCL_GETKMSGREDIRECT needed by the userland suspend tool to get the current value of kmsg_redirect from the kernel so that it can save it and restore it after resume.

---
 drivers/char/vt.c     |    4 ++++
 include/linux/tiocl.h |    1 +
 2 files changed, 5 insertions(+)
drivers/char/vt.c +4 -0
Index: linux-2.6.16-mm1/drivers/char/vt.c
===================================================================
@@ -2328,6 +2328,10 @@ int tioclinux(struct tty_struct *tty, un
 		case TIOCL_SETVESABLANK:
 			set_vesa_blanking(p);
 			break;
+		case TIOCL_GETKMSGREDIRECT:
+			data = kmsg_redirect;
+			ret = __put_user(data, p);
+			break;
 		case TIOCL_SETKMSGREDIRECT:
 			if (!capable(CAP_SYS_ADMIN)) {
 				ret = -EPERM;
include/linux/tiocl.h +1 -0
Index: linux-2.6.16-mm1/include/linux/tiocl.h
===================================================================
@@ -34,5 +34,6 @@ struct tiocl_selection {
 #define TIOCL_SCROLLCONSOLE	13	/* scroll console */
 #define TIOCL_BLANKSCREEN	14	/* keep screen blank even if a key is pressed */
 #define TIOCL_BLANKEDSCREEN	15	/* return which vt was blanked */
+#define TIOCL_GETKMSGREDIRECT	17	/* get the vt the kernel messages are restricted to */
 
 #endif /* _LINUX_TIOCL_H */
#1 lore raw
Quoted 5 lines · Rafael J. Wysocki

Add TIOCL_GETKMSGREDIRECT needed by the userland suspend tool to get the current value of kmsg_redirect from the kernel so that it can save it and restore it after resume.

ACK, FWIW.

Signature · 1 line
Thanks, Sharp!