From 3cf900afec2aff896e54b02214e9c9d023d0cd20 Mon Sep 17 00:00:00 2001 From: Akinori MUSHA Date: Mon, 3 Apr 2000 15:28:30 +0000 Subject: This is rtc, a kernel module for /dev/rtc device support. Some apps such as VMware for Linux would be happy with it. The code was originally written by Vladimir N. Silyaev. Note: It _includes_ Linux ioctl support, but basically it's FreeBSD native stuff. I'm importing this into emulators category for convevience' sake. Check it out. --- emulators/rtc/files/test.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 emulators/rtc/files/test.c (limited to 'emulators/rtc/files/test.c') diff --git a/emulators/rtc/files/test.c b/emulators/rtc/files/test.c new file mode 100644 index 000000000000..664441c20663 --- /dev/null +++ b/emulators/rtc/files/test.c @@ -0,0 +1,56 @@ +#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