[patch] turning devctl into a "multiple openable" device

Baptiste Daroussin bapt at freebsd.org
Wed Nov 30 15:46:03 UTC 2011


On Wed, Nov 30, 2011 at 10:05:11AM -0500, John Baldwin wrote:
> On Wednesday, November 30, 2011 7:43:20 am Baptiste Daroussin wrote:
> > Hi all,
> > 
> > With the help of cognet, I wrote a patch to turn devctl into a multiple openable
> > device, that mean that it will allow to open /dev/devctl in multiple programs,
> > for example hald and everythings that want to receive notification from the
> > device won't need to depend on haveing devd running.
> > 
> > here is the patch: 
> > http://people.freebsd.org/~bapt/devctl_multi_open.diff
> 
> Shouldn't devctl_queue_data_f() use the requested malloc() flags instead of
> hardcoding M_NOWAIT?

you are right, I'll fix that.
> 
> Also, I know that it was an intentional design decisison by Warner to have
> the multiplexing of devctl data done in userland via devd rather than in the
> kernel.  (I think he envisioned devd providing a UNIX domain socket or some
> such for other daemons to use to listen to events.)  Have you asked him about
> this change?

I haven't discussed this with him, I just CC him now to have his opinion.

In fact for somecase I find useful to have useland application able to get
notification from device without having devd running at all plus the devctl(4)
manpage says: 
" This design allows only one reader for /dev/devctl.  This is not desirable in
the long run, but will get a lot of hair out of this implementation.  Maybe we
should make this device a clonable device."

that's why I didn't first spoke to Warner about this, which has been a mistake
sorry about that.

regards,
Bapt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20111130/154eb109/attachment.pgp


More information about the freebsd-current mailing list