Results 1 to 3 of 3
Hi all,
I'm trying to copy a structure instance into a userspace buffer using copy_to_user. I understood that the buffer is being copied from kernel space to user space, but ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 12-04-2009 #1Just Joined!
- Join Date
- Nov 2009
- Posts
- 16
reading a buffer in a userspace program
Hi all,
I'm trying to copy a structure instance into a userspace buffer using copy_to_user. I understood that the buffer is being copied from kernel space to user space, but how do I use that buffer from my userspace c program?
- 12-07-2009 #2Just Joined!
- Join Date
- Feb 2008
- Posts
- 9
simpler than what you thought
You would use it exactly as if you have called a function that takes in the structure pointer (i.e. structure by reference) and that function has filled up the structure for you. Of course, you need to allocate the memory for the structure in the user space before making the system call, just like you would before expecting a C library function that fills up the structure for you.
- 12-07-2009 #3Just Joined!
- Join Date
- Nov 2009
- Posts
- 16
hey,
thanks a lot, but i had figured it out!


Reply With Quote
