#include #include #include #include #include #include #include #include "rtc.h" int main(void) { int rtc; fd_set rset; int i,rc; int ntests=100; struct timeval tv; struct timeval begin,end,delta; rtc = open("/dev/rtc", O_RDONLY); if (rtc<0) { perror("/dec/rtc"); return 1; } rc = ioctl(rtc, RTCIO_IRQP_SET, 512); if (rc<0) { perror("/dev/rtc"); return 1; } rc = ioctl(rtc, RTCIO_PIE_ON, NULL); if (rc<0) { perror("/dev/rtc"); return 1; } gettimeofday(&begin, NULL); for (i=0; i