3 --- src/rtctimer.c.orig 2003-10-27 09:49:39.000000000 -0500
10 #include <linux/rtc.h>
15 @@ -41,6 +43,7 @@ struct rtctimer_s
17 rtctimer_t *rtctimer_new( int verbose )
20 rtctimer_t *rtctimer = malloc( sizeof( rtctimer_t ) );
21 if( !rtctimer ) return 0;
23 @@ -74,17 +77,23 @@ rtctimer_t *rtctimer_new( int verbose )
24 rtctimer->current_hz = 0;
32 void rtctimer_delete( rtctimer_t *rtctimer )
35 rtctimer_stop_clock( rtctimer );
36 close( rtctimer->rtc_fd );
41 int rtctimer_next_tick( rtctimer_t *rtctimer )
44 unsigned long rtc_data;
46 pfd.fd = rtctimer->rtc_fd;
47 @@ -108,11 +117,13 @@ again:
50 read( rtctimer->rtc_fd, &rtc_data, sizeof( rtc_data ) );
55 int rtctimer_set_interval( rtctimer_t *rtctimer, int hz )
60 if( hz == rtctimer->current_hz ) {
61 @@ -136,11 +147,13 @@ int rtctimer_set_interval( rtctimer_t *r
62 rtctimer_start_clock( rtctimer );
69 int rtctimer_start_clock( rtctimer_t *rtctimer )
72 if( !rtctimer->rtc_running ) {
73 if( ioctl( rtctimer->rtc_fd, RTC_PIE_ON, 0 ) < 0 ) {
74 if( rtctimer->verbose ) {
75 @@ -152,10 +165,12 @@ int rtctimer_start_clock( rtctimer_t *rt
76 rtctimer->rtc_running = 1;
78 return rtctimer->rtc_running;
82 int rtctimer_stop_clock( rtctimer_t *rtctimer )
85 int was_running = rtctimer->rtc_running;
87 if( rtctimer->rtc_running ) {
88 @@ -170,16 +185,23 @@ int rtctimer_stop_clock( rtctimer_t *rtc
97 int rtctimer_get_resolution( rtctimer_t *rtctimer )
100 return rtctimer->current_hz;
104 int rtctimer_get_usecs( rtctimer_t *rtctimer )
107 return rtctimer->usecs;
111 int set_realtime_priority( int max )