Re: TIOCGDEV ioctl

From: Dr. Werner Fink (werner@suse.de)
Date: Thu Dec 21 2000 - 09:22:49 EST


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 revisions, so using it is
> > an ugly hack. Grab for TIOCTTYGSTRUCT_HACK in the bootlogd.c file of the
> > sysvinit sources. Shudder!
>
> 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)

Not a symlink but this is what is needed: if fd 0 of the current task is a
tty then give the hash of the tty. I'm using fd 0 because current->tty may
not be set for spawned tasks of init.

I've attached two patches, one for 2.4 and one for 2.2. They're rather
simple, therefore one may use this for setting a link.

        Werner

BTW: I'm missing a real replacement for my sys_revoke() patch done at the
end of October. Al Viro has wipe it out but never shows an alternative way
of implementing such a beast.





-
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:28 EST