Re: New IOCTLs

From: Valdis . Kletnieks
Date: Wed Sep 17 2008 - 13:46:01 EST


On Wed, 17 Sep 2008 22:25:35 +0530, Singaravelan Nallasellan said:
> I need to send device control messages to the driver. I am planning to
> use the IOCTLs. But I came to know that Linux community does not
> accept any new IOCTLs anymore.

New IOCTL's are *not* in the "not accepting any new" state. However, there
*will* be questioning whether a new IOCTL is the proper API, or if there
should be some other interface instead (sysfs, debugfs, netlink, and so on).

The basic problem with IOCTLs is that they tend to quickly become ugly design,
with little attention paid to things like proper 32/64 bit interfaces (what
happens when a 32-bit program tries to pass a parameter to a 32-bit
kernel, and to a 64-bit kernel?).

Maybe an ioctl is the right way to send your device control messages. Maybe
some other API is better. What sort of messages need to be sent, and what
sort of throughput/latency requirements are there, and so on? If you tell us
more about what you're trying to get to/from userspace and the device, we
can better suggest what to do...

Attachment: pgp00000.pgp
Description: PGP signature