Re: tty->name conversion?

From: Albert D. Cahalan (acahalan@cs.uml.edu)
Date: Fri Jul 13 2001 - 12:43:16 EST


Taral writes:

> I noticed that ps still relies on device numbers to determine tty, since
> /proc/*/stat only exports the device number. Is there any way to get the
> device name? I noticed that it is not present in tty_struct anywhere
> (proc_pid_stat() uses task->tty->device, which is a kdev_t).
>
> This would be useful to consider if we ever intend to create real
> unnumbered character/block devices.

This isn't quite true, at least for the version shipped with Debian.

The non-existant /proc/*/tty link is examined first. This is
because several people have agreed that such a link would be
good, even though it is difficult to implement with the current
code. I think viro, hpa, and tytso have all looked into this.

The ps code also looks at /proc/*/fd/* when possible. This often
gives a real filename. Otherwise, ps has to guess a name based
on the device number and either a hard-coded table or information
from /proc/tty/drivers.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Jul 15 2001 - 21:00:19 EST