Re: ioctl()

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

 



ioctls are also known as generic system calls. Its a simple switch
case implementation inside a device.
you send command and argument through ioctls as parameters.
Its a way you use to interact with the device itself.

for using it just open the device and use its fd to invoke ioctls.

for eg.

fd = open("/dev/mydev", O_RDONLY);

ioctl(fd, cmd, argument);


its internal representation is something like:

ioctl( struct file *, struct inode*, unsigned int cmd, unsigned long arg)
{
    switch(cmd) {
                         case 1:  .......
                         case 2:  .........
     }
}

for more details refer Beginning Linux Programming.
I hope that helps.

On Sat, Jan 3, 2009 at 4:35 PM, rishi agrawal <postrishi@xxxxxxxxx> wrote:
>
> If you are new to Kernel Programming then you should go to The Latest
> version of The Linux Kernel Module Programming Guide
>
> just google for it
>
> On Sat, Jan 3, 2009 at 3:15 PM, niamathullah sharief <shariefbe@xxxxxxxxxxx>
> wrote:
>>
>> i know that "ioctl()" is an system call....but can anyone tell me how it
>> works...from where it called....?
>> ________________________________
>> Add more friends to your messenger and enjoy! Invite them now.
>
>
> --
> Regards,
> Rishi B. Agrawal
>
>

--
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