linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* tty->name conversion?
@ 2001-07-05  7:36 Taral
  2001-07-13 17:43 ` Albert D. Cahalan
  0 siblings, 1 reply; 3+ messages in thread
From: Taral @ 2001-07-05  7:36 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 596 bytes --]

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.

-- 
Taral <taral@taral.net>
(This message is digitally signed. Please encrypt mail if possible.)
"Any technology, no matter how primitive, is magic to those who don't
understand it." -- Florence Ambrose

[-- Attachment #2: Type: application/pgp-signature, Size: 240 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: tty->name conversion?
  2001-07-05  7:36 tty->name conversion? Taral
@ 2001-07-13 17:43 ` Albert D. Cahalan
  2001-07-13 19:34   ` Taral
  0 siblings, 1 reply; 3+ messages in thread
From: Albert D. Cahalan @ 2001-07-13 17:43 UTC (permalink / raw)
  To: Taral; +Cc: linux-kernel

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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: tty->name conversion?
  2001-07-13 17:43 ` Albert D. Cahalan
@ 2001-07-13 19:34   ` Taral
  0 siblings, 0 replies; 3+ messages in thread
From: Taral @ 2001-07-13 19:34 UTC (permalink / raw)
  To: Albert D. Cahalan; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1090 bytes --]

On Fri, Jul 13, 2001 at 01:43:16PM -0400, Albert D. Cahalan wrote:
> 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.

<snip>

Thanks for your reply. It still remains, however, that for processes
that you do not own, it has to guess, viz:

  319 taral    vc/1     S    Jul12 -zsh
  320 root     tty2     S    Jul12 /sbin/getty 38400 vc/2

Notice that the getty is listed as tty2, even though it opened
/dev/vc/2.

-- 
Taral <taral@taral.net>
This message is digitally signed. Please PGP encrypt mail to me.
"Any technology, no matter how primitive, is magic to those who don't
understand it." -- Florence Ambrose

[-- Attachment #2: Type: application/pgp-signature, Size: 240 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-07-13 19:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-05  7:36 tty->name conversion? Taral
2001-07-13 17:43 ` Albert D. Cahalan
2001-07-13 19:34   ` Taral

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).