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 <[email protected]> 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 <[email protected]>
> 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 [email protected]
Please read the FAQ at http://kernelnewbies.org/FAQ