Re: PROPOSAL: /proc/dev

Miquel van Smoorenburg (miquels@cistron.nl)
4 Jan 1998 15:37:34 +0100


In article <199801040041.LAA16254@vindaloo.atnf.CSIRO.AU>,
Richard Gooch <rgooch@atnf.CSIRO.AU> wrote:
>Linus Torvalds writes:
>> But the good thing with a devfs would be that the /dev directory would
>> only be populated with devices that we actually have - so it wouldn't be
>> nearly as large as a "real" /dev.
>
>Yep. Plus other clever things you can then do:
>
>> Btw, devfs should probably think long and hard about pty's...
>
>I don't know what you had in mind here. There is the issue of
>registering all these /dev entries, but it should be easy enough to
>come up with an interface which doesn't require a driver to call
>dev_register() a zillion times (i.e. code in devfs effectively does
>the individual registrations).

Well the standard way of finding a pty pair is to try opening all of
them one by one, starting at ptyp0 until you find one. You could create a
system where you make sure that there's always ONE spare pty pair present.
As soon as that one gets opened you create a new spare one. That way you
will never have more ptys in /dev as there have been used. That would
be pretty cool :)

Mike.

-- 
 Miquel van Smoorenburg |  The dyslexic, agnostic, insomniac lay in his bed
    miquels@cistron.nl  |  awake all night wondering if there is a doG