Re: Accessing a user space variable from a kernel module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 20 Jan 2005 03:26:20 -0800 (PST), maryam karimi
<maryam_karimi62@xxxxxxxxx> wrote:
> thanks a lot 
> it was useful 
> but I want the hole source code acts like below: 
> the user space sends the kernel space a string and the kernel should show it
>   
> sincerely yours
> 

to copy nbytes of data from user to kernel,
copy_from_user(destination(in kernel), source, n bytes);

or if you want just a word,
get_user(to, address);

see asm/uaccess.h

regards manish

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux