Messages in this thread | | | Date | Sun, 3 Aug 2008 13:56:22 +0100 | From | Alan Cox <> | Subject | Re: ioctl's suck? |
| |
> I could add a control device and pass ascii strings for status and OOB > messages, would that be an improvement?
Usually not. The idea that ioctl can be replaced with ascii messages is clueless rubbish that generally gets spouted by people with their head in the clouds of conceptual elegance and no grasp of reality.
There are certain things you can expose that way usefully via sysfs - things like general stateless status information. Ioctl however provides an interface tied to file handle not name (which is essential in a hotplug environment) and an ordering to events so you know the response you get matches the query you made.
There are good things to do with ioctls: - Make sure the size of all the fields are consistent across 32/64bit (for 32bit binaries on 64bit) - Use the IOR/IOW/IORW macros
Alan
| |