Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] 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.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@suse.cz>
Cc: Michael Kerrisk <mtk-manpages@gmx.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Rafael J. Wysocki and committed by
Linus Torvalds
0ca07731 d32af0fe

+5
+4
drivers/char/vt.c
··· 2328 2328 case TIOCL_SETVESABLANK: 2329 2329 set_vesa_blanking(p); 2330 2330 break; 2331 + case TIOCL_GETKMSGREDIRECT: 2332 + data = kmsg_redirect; 2333 + ret = __put_user(data, p); 2334 + break; 2331 2335 case TIOCL_SETKMSGREDIRECT: 2332 2336 if (!capable(CAP_SYS_ADMIN)) { 2333 2337 ret = -EPERM;
+1
include/linux/tiocl.h
··· 34 34 #define TIOCL_SCROLLCONSOLE 13 /* scroll console */ 35 35 #define TIOCL_BLANKSCREEN 14 /* keep screen blank even if a key is pressed */ 36 36 #define TIOCL_BLANKEDSCREEN 15 /* return which vt was blanked */ 37 + #define TIOCL_GETKMSGREDIRECT 17 /* get the vt the kernel messages are restricted to */ 37 38 38 39 #endif /* _LINUX_TIOCL_H */