Messages in this thread | | | From | "Albert D. Cahalan" <> | Subject | Re: tty->name conversion? | Date | Fri, 13 Jul 2001 13:43:16 -0400 (EDT) |
| |
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/
| |