mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Miquel van Smoorenburg" <miquels@cistron.nl>
To: linux-kernel@vger.kernel.org
Subject: Re: Why does x86_64 support a SuSE-specific ioctl?
Date: Wed, 9 Oct 2002 18:03:08 +0000 (UTC)	[thread overview]
Message-ID: <ao1r0s$o8b$1@ncc1701.cistron.net> (raw)
In-Reply-To: <ann5s4$87a$1@ncc1701.cistron.net>

In article <ann5s4$87a$1@ncc1701.cistron.net>,
Miquel van Smoorenburg <miquels@cistron.nl> wrote:
>So you need to know what the _real_ console is so you can write
>a copy to the real console. The only way to find that out is
>to call TIOCGDEV on /dev/console, then scan /dev. That is
>what bootlogd does, I've tried to get TIOCGDEV in the kernel
>since 2.2 days but gave up because it was ignored. So bootlogd
>has always been 'experimental', though it is very useful,
>since it has no kernel support.
>
>Now, to solve this particular problem, there are a few
>alternatives.
>
>One is a TIOCCONS_COPY ioctl, so that output is not redirected
>but copied to the pty.
>
>Another, perhaps more elegant solution is that writes
>to the pty slave that receives the console output should
>go to the real console. A swap instead of a redirect.

That doesn't work since other OSes redirect both input and
output, and while we don't do that we don't want to change
semantics too much.

How about _not_ doing the redirect for filehandles opened
with O_DIRECT ?

--- linux-2.4.19/drivers/char/tty_io.c.orig	Sat Aug  3 02:39:43 2002
+++ linux-2.4.19/drivers/char/tty_io.c	Wed Oct  9 20:01:26 2002
@@ -755,7 +755,7 @@
 	is_console = (inode->i_rdev == SYSCONS_DEV ||
 		      inode->i_rdev == CONSOLE_DEV);
 
-	if (is_console && redirect)
+	if (is_console && redirect && !(file->f_flags & O_DIRECT))
 		tty = redirect;
 	else
 		tty = (struct tty_struct *)file->private_data;

Mike.


  reply	other threads:[~2002-10-09 17:58 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.NEB.4.44.0210041654570.11119-100000@mimas.fachschaften.tu-muenchen.de.suse.lists.linux.kernel>
2002-10-05  4:35 ` Andi Kleen
2002-10-05  5:04   ` Jeff Garzik
2002-10-05  5:10     ` Andi Kleen
2002-10-05 13:21       ` Alan Cox
2002-10-05 15:19         ` TIOCGDEV Andi Kleen
2002-10-05 17:00         ` Why does x86_64 support a SuSE-specific ioctl? Miquel van Smoorenburg
2002-10-09 18:03           ` Miquel van Smoorenburg [this message]
2002-10-05  7:56   ` H. Peter Anvin
2002-10-05 15:00     ` Andi Kleen
2002-10-07 17:48       ` Marcelo Tosatti
2002-10-05 13:20   ` Alan Cox
2002-10-05 14:36     ` Andrea Arcangeli
2002-10-04 14:59 Adrian Bunk

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='ao1r0s$o8b$1@ncc1701.cistron.net' \
    --to=miquels@cistron.nl \
    --cc=linux-kernel@vger.kernel.org \
    /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®