Does copy_from_user modify the user pointer?

Posted by Michael on Stack Overflow See other posts from Stack Overflow or by Michael
Published on 2012-09-18T02:55:39Z Indexed on 2012/09/18 3:37 UTC
Read the original article Hit count: 353

Does the copy_from_user function, declared in uaccess.h, modify the (void __user *)from pointer? The pointer isn't declared as const in the function declaration, only the contents it points to.

The reason I ask is that I want to use copy_from_user twice, with the second copy_from_user copying from the place where the first one finished.

I was planning on doing something like this, is it guaranteed to work?

//buf is a user pointer that is already defined
copy_from_user(my_first_alloced_region, buf, some_size);
//do stuff
copy_from_user(my_second_alloced_region, buf + some_size, some_other_size);

Thanks in advance.

© Stack Overflow or respective owner

Related posts about c

    Related posts about linux