Request for PTY/devfs changes

John Baldwin jhb at freebsd.org
Mon Jan 8 11:20:21 PST 2007


On Saturday 06 January 2007 16:36, Ed Schouten wrote:
> * Poul-Henning Kamp <phk at phk.freebsd.dk> wrote:
> > It doesn't even work to send a "this if for a create" flag along
> > for the dev_clone, because another process might race in and do
> > something silly before we get to that level.
> 
> Sorry - I can't quite understand this. You mean a situation where two
> threads perform an open() on the same filename at the same time could
> cause two pty's to be allocated with the same name? But how is that
> covered at this moment when two threads perform a stat() or open() at
> the same time?

devfs doesn't seem to handle any of this for you at all, forcing each bit
of code that uses dev_clone to manage all this itself. :(  When a device
is opened you can mark it as opened.  Perhaps you can have a callout that
periodically checks to see if there are any "orphans" created due to a
stat() and if so schedule a task on a taskqueue to purge them.  I need to
figure out something sane for /dev/ipmi0 before I can turn on cloning
there myself.

-- 
John Baldwin


More information about the freebsd-arch mailing list