Hello
After re-reading my mail i considerd sending some example code, wich shouldn
work with:
Kernel 2.6.8-2-686 and module genrtc.ko loaded
but works with:
Kernel 2.6.8-2-686 and module rtc.ko loaded.
Maybe this is a general kernel issue, or an issue with my machine. If so, i am
again really sorry for the inconvenience.
Thank you very much
konrad
#include
#include
#include
#include
#include
#include
#include
#include
int main() {
int fd;
unsigned long int ioret;
int rtcread;
int counter;
int fc;
unsigned long rtcdata;
unsigned long irqrate = 8;
unsigned long test;
fd = open("/dev/rtc", O_RDONLY);
if ( fd == -1 ) {
printf("error opening rtc \n");
exit(0);
}
ioret = ioctl(fd,RTC_IRQP_SET,64);
/* breaks here with 'set failed: invalid argument' on genrtc.ko */
if ( ioret == -1 ) {
perror("set failed");
exit(0);
}
ioret = ioctl(fd,RTC_PIE_ON,0);
if ( ioret == -1 ) {
printf(": %u \n",ioret);
perror("set failed");
exit(0);
}
for ( counter = 0; counter < 4 ; counter++ ) {
rtcread = read(fd,&rtcdata,sizeof(unsigned long));
printf(".",rtcread);
fflush(stdout);
}
printf("\n");
close(fd);
}
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]