Bug#358017: ioctl rtc example

2008-12-24 Thread Moritz Muehlenhoff
reassign 358017 linux-2.6
thanks

On Mon, Mar 20, 2006 at 09:50:02PM +0100, Konrad Schandera wrote:
> 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.

Does this behaviour still occur with more recent kernel versions?

Cheers,
Moritz



-- 
To UNSUBSCRIBE, email to debian-kernel-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#358017: ioctl rtc example

2006-03-20 Thread Konrad Schandera
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]