Results 1 to 2 of 2
Thread: How to use 'copy_to_user'?
|
Enjoy an ad free experience by logging in. Not a member yet? Register.
|
|
-
03-31-2011 #1
- Join Date
- Mar 2011
- Posts
- 1
How to use 'copy_to_user'?
Thanks.
-
04-01-2011 #2
- Join Date
- Apr 2011
- Posts
- 1
view the manpage of copy_to_user.
Essentially it bridges the gap between kernel space and user space so you can copy data from kernel to user.
unsigned long copy_to_user (void __user * to, const void * from, unsigned long n);
Typically you would have a read function in your driver that passes in a pointer from user space and you would use that in the to argument. The from argument is just some pointer reference to data you have put data into on the driver side. The unsigned long n parameter is the number of bytes to copy from kernel to user.