Re: TIOCGDEV ioctl

From: Miquel van Smoorenburg (miquels@cistron.nl)
Date: Sat Dec 16 2000 - 05:46:45 EST


According to Alexander Viro:
> On Fri, 15 Dec 2000, Linus Torvalds wrote:
>
> > Please instead do the same thing /dev/tty does, namely a sane interface
> > that shows it as a symlink in /proc (or even in /dev)
>
> There you go... (/proc/tty/console -> /dev/tty<current_VC>; may very well

The current VT (fg_console) and /dev/console are 2 different things ...
/dev/console might be /dev/ttyS1. Besides to get at fg_console
we already have ioctl(/dev/tty0, TIOCLINUX, 12)

There is currently no way to find out with what device /dev/console
is associated.

Why is that needed? For example, I wrote a program 'bootlogd' that opens
/dev/console and a pty pair, uses TIOCCONS to redirect console
messages to the pty pair so they can be logged. However one would
like to write those messages to the _actual_ console as well, but
there is no way to find out what the real console is.

For this application a ioctl is better than a /proc symlink since
it would be started before /proc is even mounted.

Mike.

-- 
RAND USR 16514
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Dec 23 2000 - 21:00:15 EST