On Sat, 16 Dec 2000, Miquel van Smoorenburg wrote:
> 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.
So mount it... It's not like you didn't have enough privileges for that,
after all, and mount("proc", "/proc", "proc", 0, 0); doesn't look too
complex.
OK, I can see the point of finding out where the console is redirected
to. How about the following:
/proc/sys/vc -> /dev/tty<n>
/proc/sys/console -> where the hell did we redirect it or
vc if there's no redirect right now
Will that be OK with you?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/