From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Brian Beattie <beattie@beattie-home.net>
Cc: linux-kernel@vger.kernel.org
Subject: Re: ioctl's suck?
Date: Sun, 3 Aug 2008 13:56:22 +0100 [thread overview]
Message-ID: <20080803135622.7f624327@lxorguk.ukuu.org.uk> (raw)
In-Reply-To: <1217714096.6280.35.camel@kokopelli>
> 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
next prev parent reply other threads:[~2008-08-03 13:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-02 21:54 Brian Beattie
2008-08-03 1:18 ` Mikael Pettersson
2008-08-03 12:56 ` Alan Cox [this message]
2008-08-03 17:04 ` Brian Beattie
[not found] <fa.pDV0CxkUWw00OFrnybFqbUSeaQA@ifi.uio.no>
2008-08-03 1:36 ` Robert Hancock
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080803135622.7f624327@lxorguk.ukuu.org.uk \
--to=alan@lxorguk.ukuu.org.uk \
--cc=beattie@beattie-home.net \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®