Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8543065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T12:12:54+00:00 2026-06-11T12:12:54+00:00

Does the copy_from_user function, declared in uaccess.h, modify the (void __user *)from pointer? The

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T12:12:56+00:00Added an answer on June 11, 2026 at 12:12 pm

    The callee function can’t modify the pointer itself since you’re simply passing the pointer-value as an argument to the function. If the argument is declared as a pointer to a const type, then the callee can’t modify what is being pointed to either (at least not without a cast that would cast away the const-ness of the pointer). The only way to modify the pointer value in the caller itself would be to pass the callee a pointer-to-pointer type.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How exactly does the copy_from_user() function work internally? Does it use any buffers or
Does anyone know of an easy way to copy a database from one computer
I've been trying to modify the AuditTrail code so that it does not copy
Does glUniformMatrix4fv instantly copy data pointed to by the passed in pointer? If not
Some background: I have to use function HMR from package HMR a lot. Unfortunately,
How does a copy constructor work in c++ Error 1 error C2064: term does
I'm writing a lua script, and one of the things it does is copy
I have a class which does not have copy constructor or operator= overloaded. The
Does vector::operator= change vector capacity? If so, how? Does vector's copy constructor copy capacity?
Does anyone know of a way to copy mail attachments of a particular extention

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.