确保命令 RTC_RD_TIME 是正确定义的,并且结构体 rtc_time 是按照系统头文件中的定义来使用的。 确认/dev/rtc0 设备是否存在且可访问: 使用ls -l /dev/rtc0 命令来检查设备文件是否存在以及它的权限设置。如果设备文件不存在,可能是因为 RTC 模块没有正确加载,或者你的系统不支持 RTC 设备。你可以尝试加载 RTC
The purpose of a battery-backupped hw clock however is to keep time, especially on power loss. Diagnosis Origin of theioctl(RTC_RD_TIME) to /dev/rtc to read the time failed: Invalid argumenterror. The origin can be tracked down tothis commitand these 2 lines of code: ...