Re: writing new socket ioctls

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

 



Aiee :)

   Hello!

On Tue, Sep 18, 2001 at 10:39:06AM -0700, Anil Kumar wrote:
> After passing the argument in
> ioctl(socketfd,NEWSOCKIOCTL,NULL) now the next thing I
> want  to do is  to pass an argument to the ioctl
> call.I passed a NULL in the first dummy example. Now

   The userspace ioctl(2) syscall support variables args list
   so isn't mandatory to pass NULL as third arg; just ommit it 
   (well, never mind about this tho).

> if I need to send reference to my own structure,how do
> i access this user space argument inside af_inet.c? Or
> do I need to write a translating function which
> converts the user data from user to kernel space? I

   Just look at some function that do that;

   i.e. looking at devinet_ioctl(), defined in net/ipv4/devinet.c
   called by inet_ioctl() should give to you a clear skeleton to
   follow (you can see that copy_from_user() gets called to copy
   the third ioctl args from userland to kernel space) ... 
   and so on ...

   It shouldn't be so hard ...

bye bye

                  -- gg sullivan

-- 
Lorenzo Cavallaro	`Gigi Sullivan' <sullivan@sikurezza.org>

Until I loved, life had no beauty;
I did not know I lived until I had loved. (Theodor Korner)

-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/


[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