diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2006-03-31 05:30:58 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-31 15:18:56 -0500 |
commit | 0ca07731e495584bd84dca15a0f065470d594ec4 (patch) | |
tree | d043e8b64b43361051e1e6b40ee37382591825df | |
parent | d32af0fe11b1618572389723e93cf33a4cc11c81 (diff) |
[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>
-rw-r--r-- | drivers/char/vt.c | 4 | ||||
-rw-r--r-- | include/linux/tiocl.h | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/drivers/char/vt.c b/drivers/char/vt.c index ca4844c527da..acc5d47844eb 100644 --- a/drivers/char/vt.c +++ b/drivers/char/vt.c | |||
@@ -2328,6 +2328,10 @@ int tioclinux(struct tty_struct *tty, unsigned long arg) | |||
2328 | case TIOCL_SETVESABLANK: | 2328 | case TIOCL_SETVESABLANK: |
2329 | set_vesa_blanking(p); | 2329 | set_vesa_blanking(p); |
2330 | break; | 2330 | break; |
2331 | case TIOCL_GETKMSGREDIRECT: | ||
2332 | data = kmsg_redirect; | ||
2333 | ret = __put_user(data, p); | ||
2334 | break; | ||
2331 | case TIOCL_SETKMSGREDIRECT: | 2335 | case TIOCL_SETKMSGREDIRECT: |
2332 | if (!capable(CAP_SYS_ADMIN)) { | 2336 | if (!capable(CAP_SYS_ADMIN)) { |
2333 | ret = -EPERM; | 2337 | ret = -EPERM; |
diff --git a/include/linux/tiocl.h b/include/linux/tiocl.h index 2c9e847f6ed1..4756862c4ed4 100644 --- a/include/linux/tiocl.h +++ b/include/linux/tiocl.h | |||
@@ -34,5 +34,6 @@ struct tiocl_selection { | |||
34 | #define TIOCL_SCROLLCONSOLE 13 /* scroll console */ | 34 | #define TIOCL_SCROLLCONSOLE 13 /* scroll console */ |
35 | #define TIOCL_BLANKSCREEN 14 /* keep screen blank even if a key is pressed */ | 35 | #define TIOCL_BLANKSCREEN 14 /* keep screen blank even if a key is pressed */ |
36 | #define TIOCL_BLANKEDSCREEN 15 /* return which vt was blanked */ | 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 | #endif /* _LINUX_TIOCL_H */ | 39 | #endif /* _LINUX_TIOCL_H */ |