Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    a question about copy_from_user/copy_to_user

    I am newbie to linux kernel, I'm write ioctl function, the input argument is integer, kernel space need to use this integer argument within user space, should I to use copy_from_user() function or directly to use it?

    When I can directly to use user space data in kernel space?



  2. #2
    Linux Enthusiast gerard4143's Avatar
    Join Date
    Dec 2007
    Canada, Prince Edward Island
    You should use copy_from_user() because it performs some rudimentary checks on the address location of the data plus it guarantees a level compatibility but if thats not a concern you could pass a pointer to the data...Hope this helps Gerard4143

    Welcome to the forums

  3. #3
    Thank your help!

  4. $spacer_open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts