Re: Why not ioctl()?

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

 



On Fri, Mar 17, 2006 at 03:44:05PM +0100, Yang Huang wrote:
> Hi list,
> 
> I have seen many people complaint about over-use of ioctl() for
> drivers, but why it is a over-use?

It is fragile, very difficult to get right for 32 and 64 bit kernels,
not scriptable, and exposes kernel structures to userspace.  It also
allows driver writers to basically create their own syscalls, which is
generally a bad thing.

> Why using ioctl() is not
> recommended now while most books on this field still tell the new
> comers to use it?

What books recommend using it?

> If ioctl() should not be used any more, what is the best alternative?

It all depends on what you want to do.  You can use debugfs, sysfs,
configfs, relayfs, netlink, or even your own virtual filesystem.  What
do you want to do that you feel you need to create a new ioctl?

Also see the archives for the linux-kernel mailing list for more
detailed description of why using ioctls are not a good idea.

thanks,

greg k-h

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           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