Hi, I'm fairly new to Linux drivers so
I've been playing with the examples
by Ori Pomerantz.   Ori uses put_user in
a loop and copies each char in one by one,
move the pointer and returns the number of
bytes copied.  The read is then (magically) called
again and it returns zero.  I changed this file
to use copy_to_user and had to use a toggling
static to first return the bytes counted then one
the next call return 0.  I can't find the function
in the source code that calls my device_read
function because it's buried in the Fops structure
that is set when I register my device.   I don't seem
to be able to find much on either of these functions.
The main difference I see is copy_to_user will
verify the memory area and put_user wont.

BTW
Red Hat 6.1 with 2.2.14 kernel. on an intel machine.
Thanks,
Kenny


**********************************************************
To unsubscribe from this list, send mail to
[EMAIL PROTECTED] with the following text in the
*body* (*not* the subject line) of the letter:
unsubscribe gnhlug
**********************************************************

Reply via email to