Re: Patch to make powerd(8) devd(8)-aware

From: Fredrik Lindberg <fli+freebsd-current_at_shapeshifter.se>
Date: Thu, 19 May 2005 12:42:07 +0200
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
Received on Thu May 19 2005 - 08:42:14 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:34 UTC