Re: ioctl's suck?

From: Brian Beattie
Date: Sun Aug 03 2008 - 13:05:01 EST


On Sun, 2008-08-03 at 13:56 +0100, Alan Cox wrote:
> > 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.

Yeah, I can see that. Though the case has been made that ioctls are
only usable by C/C++ while I'm sure there are other languages, I'm
working in the embedded space and mostly work with C and sh so my
experience is limited and that is of less direct importance to me.

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

Yeah coherence (if I'm using that word correctly) would be critical, and
a separate file handle would make that tricky.


> Alan
--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting a bad thing?

Brian Beattie LFS12947 | "Honor isn't about making the right choices.
beattie@xxxxxxxxxxxxxxxx | It's about dealing with the consequences."
www.beattie-home.net | -- Midori Koto

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/