简体   繁体   中英

interrupts to notify events in linux

I want to write a program which notifies when the laptop battery level falls below a certain threshold level. I am using ubuntu 11.04 . Is there a way in which i can generate an interrupt without polling the battery. What system calls in linux are used to achieve this ?

There is no system call interface to ACPI in Linux... All of the I/O is done using /proc/acpi or /sys/class entries. Easiest implementation would be a polling software, and read the interface periodically (going to sleep if the threshold is not there yet) — this is because typically /proc and /sys files construct the desired information while handling the read(2).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM