3 ms·
Maybe you can ask the RTC alarm whether it's still armed. I don't know if they automatically clear the enabled flag when the alarm occurs. See RTC_WKALM_RD in h
by yencabulator 5y ago
Maybe you can ask the RTC alarm whether it's still armed. I don't know if they automatically clear the enabled flag when the alarm occurs. See RTC_WKALM_RD in https://man7.org/linux/man-pages/man4/rtc.4.html https://man7.org/linux/man-pages/man4/rtc.4.html
If not, well, you know what time the alarm is. That leaves a race, but there's a race regardless -- the human might have opened the laptop lid exactly after the RTC alarm went off.
EDIT: Yup, confirmed in kernel source, Linux makes sure /sys/devices/platform/rtc_cmos/rtc/rtc*/wakealarm is single-shot, so you can see whether it triggered.