Re: passing array from kernel space to user space

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

 



On Tue, Apr 04, 2006 at 18:55:58 +0530, taha hafeez wrote:
> On Mon, 2006-04-03 at 00:26 +0200, Vincenzo Mallozzi wrote:
> > --- taha siddiqi <tawushafeez@xxxxxxxxx> wrote:
> > 
> > > Hi
> > > 
> > > Same answer, "please explain the situation !!"
> > > 
> > > taha
> > > 
> > > Thanks.
> > 
> > The array I want to pass from kernel space to user
> > space contains pid_t elements.
> > First, I pass the length of the array from user space
> > to kernel space.
> > Then, I build the array with the given length filling
> > it with the pid of processes I need to monitor.
> > Finally, I've to pass this array of pids to the user
> > space.
> > I hope I've well explained the situation.
> > Thanks all.
> > Vincenzo Mallozzi.
> > 
> 
> Well, I think I get you now....
> 
> Correct me if I am wrong... 
> 
> 
>             data buffer
> USER_SPACE ------------>  KERNEL SPACE [fill data with pid_t]
>       ^                       |
>       |                       | 
>       *------<----------------*
>             data buffer
> 
> Why do we need to pass the data buffer to kernel ? 
> Does it contain any information that kernel needs ?
> if not, then that step can be avoided ?
> 
> Then you just need a read call implementation of 
> struct file_operations {}.

read call implements passing data FROM KERNEL (because it implements the
read syscall)
write call implements passing data TO KERNEL (because it implements the
write syscall)

> taha
> 
> 
> 
> 
> --
> Kernelnewbies: Help each other learn about the Linux kernel.
> Archive:       http://mail.nl.linux.org/kernelnewbies/
> FAQ:           http://kernelnewbies.org/faq/
> 
-- 
						 Jan 'Bulb' Hudec <bulb@xxxxxx>

Attachment: signature.asc
Description: Digital signature


[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