From: Pavel Machek <pavel@suse.cz>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [RFC][PATCH] vt: TIOCL to read kmsg_redirect from user space
Date: Mon, 27 Mar 2006 11:18:31 +0200 [thread overview]
Message-ID: <20060327091831.GE14248@elf.ucw.cz> (raw)
In-Reply-To: <200603251219.08415.rjw@sisk.pl>
Hi!
> The userland suspend tool we're working on needs to get the current value
> of kmsg_redirect from the kernel so that it can save it and restore it after
> resume. Unfortunetely there only is TIOCL_SETKMSGREDIRECT allowing us to
> set this value from the user space.
>
> The appended patch adds the "missing" TIOCL_GETKMSGREDIRECT that we
> need.
> Comments welcome.
Looks good to me.
Pavel
> drivers/char/vt.c | 4 ++++
> include/linux/tiocl.h | 1 +
> 2 files changed, 5 insertions(+)
>
> Index: linux-2.6.16-mm1/drivers/char/vt.c
> ===================================================================
> --- linux-2.6.16-mm1.orig/drivers/char/vt.c
> +++ 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;
> Index: linux-2.6.16-mm1/include/linux/tiocl.h
> ===================================================================
> --- linux-2.6.16-mm1.orig/include/linux/tiocl.h
> +++ 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 */
--
Picture of sleeping (Linux) penguin wanted...
prev parent reply other threads:[~2006-03-27 9:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-25 11:19 Rafael J. Wysocki
2006-03-27 9:18 ` Pavel Machek [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060327091831.GE14248@elf.ucw.cz \
--to=pavel@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=rjw@sisk.pl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®