lkml.org 
[lkml]   [2005]   [Dec]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRTC broken under 2.6.15-rc7-rt1 (was: Re: MPlayer broken under 2.6.15-rc7-rt1?)
From
Date
On Sat, 2005-12-31 at 21:58 +0100, Jan Engelhardt wrote:
> >Subject: Re: MPlayer broken under 2.6.15-rc7-rt1?
>
> I seriously demand that this be changed into "RTC broekn under..."! :)

Done ;)

[...]

> >
> >Index: linux-2.6.15-rc7-rt1/drivers/char/rtc.c
>
> This patch fixes the rtc BUG for me.

Yeah, attached is a program that does what mplayer does. I run it from
the command line like this:

# for i in `seq 10000`; do ./rtc_ioctl ; done

And with the patch it runs perfectly fine. Without it, it segfaults
several times.

-- Steve

#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>

#include <linux/rtc.h>

#define RTC "/dev/rtc"

int main(int argc, char **argv)
{
int fd;
unsigned long data;

if ((fd = open(RTC, O_RDONLY)) < 0) {
perror(RTC);
exit(0);
}

ioctl(fd, RTC_IRQP_SET, 1024);
ioctl(fd, RTC_PIE_ON, 0);

read(fd, &data, sizeof(data));
printf("%08lx\n",data);

close (fd);
exit(0);
}
\
 
 \ /
  Last update: 2005-12-31 23:49    [W:0.070 / U:3.420 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site