int main(int argc, char **argv)
{
int i, fd, retval, irqcount = 0;
- unsigned long tmp, data;
+ unsigned long tmp, data, old_pie_rate;
const char *rtc = default_rtc;
struct timeval start, end, diff;
}
/* Read periodic IRQ rate */
- retval = ioctl(fd, RTC_IRQP_READ, &tmp);
+ retval = ioctl(fd, RTC_IRQP_READ, &old_pie_rate);
if (retval == -1) {
/* not all RTCs support periodic IRQs */
if (errno == EINVAL) {
perror("RTC_IRQP_READ ioctl");
exit(errno);
}
- fprintf(stderr, "\nPeriodic IRQ rate is %ldHz.\n", tmp);
+ fprintf(stderr, "\nPeriodic IRQ rate is %ldHz.\n", old_pie_rate);
fprintf(stderr, "Counting 20 interrupts at:");
fflush(stderr);
}
done:
+ ioctl(fd, RTC_IRQP_SET, old_pie_rate);
+
fprintf(stderr, "\n\n\t\t\t *** Test complete ***\n");
close(fd);