Patch to make powerd(8) devd(8)-aware
Fredrik Lindberg
fli+freebsd-current at shapeshifter.se
Thu May 19 03:42:14 PDT 2005
On Wed, May 18, 2005 at 10:05:42PM -0700, Nate Lawson (nate at root.org) wrote:
> I appreciate you working on a patch for this. However, I'd prefer the
> work on the devd side go into making devctl a clonable device or follow
> the bpf route and hook up /dev/devctl0,1,2,... If you start using the
> /var/run/devd.pipe, it's not available for other consumers.
>
Yes, devctl should probably be able to have more readers, I won't argue with that.
However, devd allows any number of consumers to the devd.pipe. I've had
upto 4 programs reading devd.pipe simultaneously and they all got the same data.
> I agree that the sysctl errors should be soft at runtime although you
> should make sure that powerd(8) does not spin in a fast loop if sysctl
> returns an error (i.e. the sleep at the bottom should be called even
> when there's an error).
The usleep call is at the top of the loop so this shouldn't be an issue.
>
> Other comments:
> style(9) long sscanf line
I'm familiar with style(9), however I don't recall anything about sscanf, could you
please explain the correct behaviour in this case (except trying to reducing indent)
> extra newlines inserted into existing code
> change read() in devd_read() to return on error instead of running
> sscanf -- this will allow the indent to be reduced.
My mistakes, sorry.
Fredrik Lindberg
More information about the freebsd-current
mailing list