Closed svartalf closed 5 years ago
After a short investigation I'm thinking that this is a bad idea: uevent
file is updated rarely, only when udev
thinks that it is time. As a quick experiment, I've tried the udevadm monitor --subsystem-match=power_supply
shell command and did not received any event related to battery in twenty minutes.
udev
allows to "refresh" uevent
contents with change
event, but this event will be propagated to all possible event listeners; considering that library users will want to refresh battery data roughly each couple of seconds this will spam the listeners.
Power supply folder might contain an
uevent
file, which can be used to load battery data with a fewer syscalls amount.uevent
file by itself should be considered as optional, implementation should not check if it is exists on each refresh (confirm than kernel will not create it suddenly at some random point of time)