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

From: Fredrik Lindberg <fli+freebsd-current_at_shapeshifter.se>
Date: Mon, 16 May 2005 19:02:30 +0200
Hi

I wrote a small patch to make powerd(8) aware of devd(8), thus making the
AC line state change event driven. 
Instead of one sysctl call per iteration it just requires reading one variable 
to determine the AC line state. This should yield faster execution, and hence, 
lower power consumption. 

Events are read from /var/run/devd.pipe, therefore requires devd to be running.
If devd is not running it will use the old polling method to determinate AC state.
devd was choosen over devctl(4) because the current implementation of devctl
only allow one reader and that's usually devd(8). 

Patch avaiable at, apply with patch < -p0 in usr.sbin
http://shapeshifter.se/~fli/freebsd/powerd-devd.patch

During the same time I also discovered a bug(?) in devd which causes it
to terminate with a broken pipe if a client reading /var/run/devd.pipe 
disappears. Blocking SIGPIPE fixes this.

Patch at 
http://shapeshifter.se/~fli/freebsd/devd.cc-sigpipe.patch

You'll need the devd patch if you want to run the devd patch without problems. 

   Fredrik Lindberg
Received on Mon May 16 2005 - 15:02:37 UTC

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