public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Opinions on removing /proc/tty?
@ 2006-07-08  2:56 Jon Smirl
  2006-07-08  5:30 ` Randy.Dunlap
  2006-07-08  7:40 ` Mike Galbraith
  0 siblings, 2 replies; 29+ messages in thread
From: Jon Smirl @ 2006-07-08  2:56 UTC (permalink / raw)
  To: lkml, Alan Cox

Does anyone use the info in /proc/tty? The hard coded device names
aren't compatible with udev's ability to rename things.

There also doesn't appear to be any useful info in the drivers portion
that isn't already available in sysfs. I can add some code to make a
list of registered line disciplines appear in sysfs.

Does anyone have a problem with deleting /proc/tty if ldisc enum
support is added to sysfs?

[root@jonsmirl tty]# cat drivers
/dev/tty             /dev/tty        5       0 system:/dev/tty
/dev/console         /dev/console    5       1 system:console
/dev/ptmx            /dev/ptmx       5       2 system
/dev/vc/0            /dev/vc/0       4       0 system:vtmaster
serial               /dev/ttyS       4 64-67 serial
pty_slave            /dev/pts      136 0-1048575 pty:slave
pty_master           /dev/ptm      128 0-1048575 pty:master
unknown              /dev/tty        4 1-63 console
[root@jonsmirl tty]#

[root@jonsmirl tty]# cat ldiscs
n_tty       0

-- 
Jon Smirl
jonsmirl@gmail.com

^ permalink raw reply	[flat|nested] 29+ messages in thread
* Re: Opinions on removing /proc/tty?
@ 2006-07-09  5:30 Albert Cahalan
  2006-07-09 14:04 ` Jon Smirl
  0 siblings, 1 reply; 29+ messages in thread
From: Albert Cahalan @ 2006-07-09  5:30 UTC (permalink / raw)
  To: rmk+lkml, jonsmirl, alan, efault, greg, linux-kernel

Jon Smirl writes:
> On 7/8/06, Mike Galbraith <efault@gmx.de> wrote:
>> On Fri, 2006-07-07 at 22:56 -0400, Jon Smirl wrote:

>>> Does anyone use the info in /proc/tty? The hard coded device
>>> names aren't compatible with udev's ability to rename things.
>>>
>>> There also doesn't appear to be any useful info in the drivers
>>> portion that isn't already available in sysfs. I can add some code
>>> to make a list of registered line disciplines appear in sysfs.
>>>
>>> Does anyone have a problem with deleting /proc/tty if
>>> ldisc enum support is added to sysfs?
>>
>> ps uses /proc/tty/drivers, so some coordination would be needed.
>
> Greg, I just looked at the source for ps and it has a bunch
> of fixed code for turning major/minor into /dev/name.  Isn't
> that something udevinfo should be doing? But looking at the
> help for udevinfo I don't see any way to turn a major/minor
> into /dev/name. The altermative seems to be search /dev
> looking for the right device node.

By far, the best thing for procps (ps, top, etc.) would
be /proc/*/tty links. Code that, give everybody a year
to upgrade, and then... maybe.

There is no way I'm going to have the procps run a "udevinfo"
program, and I very much dislike relying on oddball libraries.
Reliability and performance matter; this isn't some GNOME/KDE
thing that can break just because 1 of 200 libraries changed.

In order, the procps code tries:

1. /proc/*/tty symlink (effectively commented out)
2. /proc/tty/drivers
3. /proc/*/fd/2 symlink
4. hard-coded guess
5. /proc/*/fd/255 symlink
6. "?"

Long ago, procps would search /dev for the mapping. This was
too slow to be done directly when ps ran, so a binary file in
/etc was used to cache the data. Keeping that file updated
was a major problem.

BTW, cruft gets ripped out some time after Debian-obsolete no
longer supports the old kernels.

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

end of thread, other threads:[~2006-07-13 18:48 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-08  2:56 Opinions on removing /proc/tty? Jon Smirl
2006-07-08  5:30 ` Randy.Dunlap
     [not found]   ` <9e4733910607072256q65188526uc5cb706ec3ecbaee@mail.gmail.com>
2006-07-09  5:04     ` Randy.Dunlap
     [not found]       ` <9e4733910607082220v754a000ak7e75ae4042a5e595@mail.gmail.com>
2006-07-09  5:27         ` Randy.Dunlap
2006-07-09 10:07         ` Antonino A. Daplas
     [not found]           ` <9e4733910607090645l236f17f1sb9778f0fc6c6ca01@mail.gmail.com>
2006-07-09 17:35             ` Randy.Dunlap
2006-07-09 23:31               ` Antonino A. Daplas
     [not found]                 ` <9e4733910607091744k273a7351l16abbcc6ff8c4bbd@mail.gmail.com>
2006-07-11 22:01                   ` Greg KH
     [not found]                     ` <9e4733910607111532s3fc2bb52q3f0247a9f2289d4e@mail.gmail.com>
2006-07-13 18:37                       ` Greg KH
2006-07-08  7:40 ` Mike Galbraith
2006-07-08 14:12   ` Jon Smirl
2006-07-08 14:48     ` Alan Cox
2006-07-08 16:20       ` Jon Smirl
2006-07-08 17:20         ` Russell King
2006-07-11 22:03           ` Greg KH
2006-07-08 16:12     ` Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2006-07-09  5:30 Albert Cahalan
2006-07-09 14:04 ` Jon Smirl
2006-07-09 16:23   ` Albert Cahalan
2006-07-09 17:00     ` Ray Lee
2006-07-09 17:08       ` Ray Lee
2006-07-09 19:26       ` Albert Cahalan
2006-07-09 19:31         ` Russell King
2006-07-09 19:57           ` Albert Cahalan
2006-07-10 14:02             ` Jan Engelhardt
2006-07-10 15:06               ` Albert Cahalan
2006-07-10 22:17                 ` Jan Engelhardt
2006-07-11  1:07                   ` Albert Cahalan
2006-07-11  1:48                     ` H. Peter Anvin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox