Re: TIOCGDEV ioctl

2000-12-21 Thread Dr. Werner Fink
On Fri, Dec 15, 2000 at 05:11:07PM -0800, Linus Torvalds wrote: > > > On Sat, 16 Dec 2000, Kurt Garloff wrote: > > > > The kernel provides this information -- sort of: > > It contains the TIOCTTYGSTRUCT syscall which returns a struct. Of course, > > it changes between different kernel archs and

Re: TIOCGDEV ioctl

2000-12-19 Thread Kurt Garloff
On Sat, Dec 16, 2000 at 06:57:20AM -0500, Alexander Viro wrote: > On Sat, 16 Dec 2000, Miquel van Smoorenburg wrote: > > According to Alexander Viro: > > > OK, I can see the point of finding out where the console is redirected > > > to. How about the following: > > > > > > /proc/sys/vc -> /dev/

Re: TIOCGDEV ioctl

2000-12-18 Thread James Simmons
> You're confusing /dev/console and /dev/tty0. /dev/console might be > associated with /dev/ttyS0 or /dev/lp1 Oops. Forgot about serial consoles :-( - 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 ht

Re: TIOCGDEV ioctl

2000-12-16 Thread Alexander Viro
On Sat, 16 Dec 2000, Miquel van Smoorenburg wrote: > According to Alexander Viro: > > OK, I can see the point of finding out where the console is redirected > > to. How about the following: > > > > /proc/sys/vc -> /dev/tty > > /proc/sys/console -> where the hell did we redirect it or >

Re: TIOCGDEV ioctl

2000-12-16 Thread Miquel van Smoorenburg
According to Alexander Viro: > OK, I can see the point of finding out where the console is redirected > to. How about the following: > > /proc/sys/vc -> /dev/tty > /proc/sys/console -> where the hell did we redirect it or >vc if there's no redirect right no

Re: TIOCGDEV ioctl

2000-12-16 Thread Alexander Viro
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

Re: TIOCGDEV ioctl

2000-12-16 Thread Miquel van Smoorenburg
In article <[EMAIL PROTECTED]>, James Simmons <[EMAIL PROTECTED]> wrote: >Based on fgconsole.c. I just threw it together in a few minutes. >/* > * consolewhat.c - Prints which VC /dev/console is. > */ You're confusing /dev/console and /dev/tty0. /dev/console might be associated with /dev/ttyS0 o

Re: TIOCGDEV ioctl

2000-12-16 Thread Miquel van Smoorenburg
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; may very well The current VT (fg_

Re: TIOCGDEV ioctl

2000-12-15 Thread 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; may very well be dangling, but then you have a current VC even if your /

Re: TIOCGDEV ioctl

2000-12-15 Thread James Simmons
> Hi Linus, Alan, > > some applications do need to know where the console (/dev/console) > actually maps to. For processes with a controlling terminal, you may see > it in /proc/$$/stat. However, daemons are supposed to run detached (they > don't want to get killed by ^C) and some processes lik

Re: TIOCGDEV ioctl

2000-12-15 Thread Linus Torvalds
On Sat, 16 Dec 2000, Kurt Garloff wrote: > > The kernel provides this information -- sort of: > It contains the TIOCTTYGSTRUCT syscall which returns a struct. Of course, > it changes between different kernel archs and revisions, so using it is > an ugly hack. Grab for TIOCTTYGSTRUCT_HACK in the

TIOCGDEV ioctl

2000-12-15 Thread Kurt Garloff
Hi Linus, Alan, some applications do need to know where the console (/dev/console) actually maps to. For processes with a controlling terminal, you may see it in /proc/$$/stat. However, daemons are supposed to run detached (they don't want to get killed by ^C) and some processes like init or boo