I am programming a character device for kernel 2.4.0-test1 and have the
This is not the real function but enough to describe the problem.
If I open this device and want read from it with fread() the program
sleeps perhaps for two or three seconds an then gets a segmentation
fault in fread(). If I make
it's the same behaviour. cat terminates after two or three seconds withQuote:>cat /dev/mydevice
a segmentation fault.
ssize_t dev_read(struct file *filp,char *buf, size_t count,loff_t *pos)
static int i=0,k;
printk("waitdev: I will sleep now ... szzzzhhh\n");
printk("waitdev: Good morning\n");
Now my questions:Quote:}
Do I use the interruptible_sleep_on correct ???
Is it possible that someone else than me wakes up the task
(I call wake_up_interruptible((void *)&readQ) somewhere else)?
If you need more information please let me know.