Re: How to pass data from kernel to user space in system call?

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

 



El Mon, Apr 09, 2007 at 01:10:36AM -0500 Neo Jia ha dit:
 
> I understand that the system call will use $eax to pass the return
> value to user space application. But if we have more information
> (data) to pass, are we going to pass a pointer stored in $eax also
> instead of a simple value?
> 
> Is there any other ways to pass information from kernel space to user
> space application?

the syscall interface can have a pointer as parameter that represents
a buffer to be filled in kernel space (the read() syscall is an
example). to copy data between kernel and userspace one would use the
functions copy_from_user(), copy_to_user(), get_user() and put_user().

-- 
Matthias Kaehlcke
Linux Application Developer
Barcelona

      Anyone who has never made a mistake has never tried anything new
                            (Albert Einstein)
                                                                 .''`.
    using free software / Debian GNU/Linux | http://debian.org  : :'  :
                                                                `. `'`
gpg --keyserver pgp.mit.edu --recv-keys 47D8E5D4                  `-

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at 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