Re: Opinions on removing /proc/tty?

From: Jan Engelhardt
Date: Mon Jul 10 2006 - 18:18:31 EST


>> > Just do /proc/*/tty links and all will be good. This even
>> > handles the case of two different names for the same dev_t.
>> >
>> Is this for the controlling tty? Then it should be ctty.
>
> Eeeew, an extra byte so it can look ugly.
> What other special tty is there?
>
Any fd, for that matter.

00:09 shanghai:/dev/shm > ls -l /proc/$$/fd
total 4
dr-x------ 2 jengelh users 0 Jul 11 00:16 .
dr-xr-xr-x 5 jengelh root 0 Jul 11 00:04 ..
lrwx------ 1 jengelh users 64 Jul 11 00:16 0 -> /dev/pts/2
lrwx------ 1 jengelh users 64 Jul 11 00:16 1 -> /dev/pts/2
lrwx------ 1 jengelh users 64 Jul 11 00:16 2 -> /dev/pts/2
lrwx------ 1 jengelh users 64 Jul 11 00:16 255 -> /dev/pts/2
and CTTY is /dev/tty1.

So what would /proc/$$/tty - ambiguous name - point to, the normal (attached)
or the ctty? Not to mention exotic, yet possible things

00:09 shanghai:/dev/shm > ls -l /proc/$$/fd
total 4
dr-x------ 2 jengelh users 0 Jul 11 00:16 .
dr-xr-xr-x 5 jengelh root 0 Jul 11 00:04 ..
lrwx------ 1 jengelh users 64 Jul 11 00:16 0 -> /dev/pts/1
lrwx------ 1 jengelh users 64 Jul 11 00:16 1 -> /dev/pts/2
lrwx------ 1 jengelh users 64 Jul 11 00:16 2 -> /dev/pts/3
lrwx------ 1 jengelh users 64 Jul 11 00:16 255 -> /dev/pts/4
and an even different ctty.

> It's always been "tty" in the kernel as far as I know.
> See "struct tty_struct *tty" in sched.h's struct signal_struct.
>
> Various "ps" programs have always used "TTY" or "TT".
> This makes "tt" more reasonable than "ctty".
>

Jan Engelhardt
--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/