public inbox for linux-kernel@vger.kernel.org
 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: Sat, 5 Oct 2002 17:00:52 +0000 (UTC)	[thread overview]
Message-ID: <ann5s4$87a$1@ncc1701.cistron.net> (raw)
In-Reply-To: 1033824115.3425.2.camel@irongate.swansea.linux.org.uk

In article <1033824115.3425.2.camel@irongate.swansea.linux.org.uk>,
Alan Cox  <alan@lxorguk.ukuu.org.uk> wrote:
>I see no good reason for this ioctl at all, in any tree.

Check out 'bootlogd.c' in sysvinit.

It starts at boot time, created a tty/pty pair, and does a TIOCCONS
on it. Everything that gets written to /dev/console now goes
ty the pty, so it can log all output.

However you still want to see the output on the screen. But
you can't copy it to /dev/console, because you'd get it right
back in the pty.

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.

The last one probably makes more sense - it seems
very logical, and is trivial to implement.

Mike.


  parent reply	other threads:[~2002-10-05 16:55 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 ` Why does x86_64 support a SuSE-specific ioctl? 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         ` Miquel van Smoorenburg [this message]
2002-10-09 18:03           ` Why does x86_64 support a SuSE-specific ioctl? Miquel van Smoorenburg
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='ann5s4$87a$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