Commit 0ca07731 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki Committed by Linus Torvalds

[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: default avatarRafael J. Wysocki <rjw@sisk.pl>
Acked-by: default avatarPavel Machek <pavel@suse.cz>
Cc: Michael Kerrisk <mtk-manpages@gmx.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent d32af0fe
...@@ -2328,6 +2328,10 @@ int tioclinux(struct tty_struct *tty, unsigned long arg) ...@@ -2328,6 +2328,10 @@ int tioclinux(struct tty_struct *tty, unsigned long arg)
case TIOCL_SETVESABLANK: case TIOCL_SETVESABLANK:
set_vesa_blanking(p); set_vesa_blanking(p);
break; break;
case TIOCL_GETKMSGREDIRECT:
data = kmsg_redirect;
ret = __put_user(data, p);
break;
case TIOCL_SETKMSGREDIRECT: case TIOCL_SETKMSGREDIRECT:
if (!capable(CAP_SYS_ADMIN)) { if (!capable(CAP_SYS_ADMIN)) {
ret = -EPERM; ret = -EPERM;
......
...@@ -34,5 +34,6 @@ struct tiocl_selection { ...@@ -34,5 +34,6 @@ struct tiocl_selection {
#define TIOCL_SCROLLCONSOLE 13 /* scroll console */ #define TIOCL_SCROLLCONSOLE 13 /* scroll console */
#define TIOCL_BLANKSCREEN 14 /* keep screen blank even if a key is pressed */ #define TIOCL_BLANKSCREEN 14 /* keep screen blank even if a key is pressed */
#define TIOCL_BLANKEDSCREEN 15 /* return which vt was blanked */ #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 */ #endif /* _LINUX_TIOCL_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment