Quantcast
Channel: Active questions tagged linux-kernel - Stack Overflow
Viewing all articles
Browse latest Browse all 12379

How to register for an "uevent" from a user application in Linux?

$
0
0

I have written battery driver and that driver sends an uevent when a power supply is changed, i.e. from AC to battery

When I run udevadm monitor I see an KERNEL and UDEVCHANGE events from power_supply subsystem upon removing AC supply.

My requirement is to notify the user application when there is an CHANGE event from power_supply subsystem. I do not want to poll for kernel message or netlink socket from user application.

Is it possible for me to register/listen for this particular ueventfrom user application and gets something like callback function whenan event occurs?


Viewing all articles
Browse latest Browse all 12379

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>