4 ms·
Nah. Just bump that responsibility to the caller, and power supply manufacturer. Have the caller call power_on_computer() first always. This will ensure you alw
by salawat 5y ago
Nah. Just bump that responsibility to the caller, and power supply manufacturer. Have the caller call power_on_computer() first always. This will ensure you always get defined state!
...What do you mean not every power supply manufacturer implements the power_on_computer() function as a NOOP if the computer is already on?!
- h2odragon 5y agoSome implement it that way, some it returns and error message or throws an NMI; then ya got the cheap clones that use it to frob a toggle without regard to the state it was in (which there's no way to read)... Then ya got the weird ones (HP) where it only works right if you call it twice with a 40ms delay between while streaming a sample from "Swan Lake" over their NDA'd 1wire thingy.
- marcodiego 5y agoI know that at least Solaris implemented SIGPWR signal to inform programs of a power failure: https://community.bmc.com/s/article/Inquira-KA334556 https://community.bmc.com/s/article/Inquira-KA334556
- marcodiego 5y agoTIL: linux also implements SIGPWR. Using "kill -PWR `pidof dd`" killed it with "power failure".