From: Andreas Dilger <adilger@clusterfs.com>
To: "Richard B. Johnson" <root@chaos.analogic.com>
Cc: Joseph Cheek <joseph@cheek.com>, linux-kernel@vger.kernel.org
Subject: Re: procedure for creating new ioctl?
Date: Mon, 10 Jun 2002 13:56:10 -0600 [thread overview]
Message-ID: <20020610195610.GO20388@turbolinux.com> (raw)
In-Reply-To: <3D04EB4F.4030107@cheek.com> <Pine.LNX.3.95.1020610141444.17491A-100000@chaos.analogic.com>
On Jun 10, 2002 14:17 -0400, Richard B. Johnson wrote:
> I use SIOCDEVPRIVATE as the starting value for new ioctls:
>
> /*
> * Interface to the private device functions. User API sees this only.
> */
> #define CHEK_SEEPROM SIOCDEVPRIVATE + 0x07
> #define READ_SEEPROM SIOCDEVPRIVATE + 0x08
> #define WRITE_SEEPROM SIOCDEVPRIVATE + 0x09
>
>
> I've seen this in several drivers. I think this is the way to do it
> so there is no interference with other ioctls.
Of course there is. That means that a program accidentally running on
the wrong device will get completely unexpected results because the
ioctl numbers will all be some value above SIOCDEVPRIVATE.
Since each of the drivers have (mostly) their own private ioctl handling,
there is less of an issue of actual ioctl number conflicts as there
is an issue that ioctl numbers should be globally unique to avoid
accidental side effects when running on an incorrect device.
Besides which, SIOCDEVPRIVATE is supposed to be for socket (networking)
ioctls and not just random ioctl values. The comment above it also
indicates this value is deprecated...
Cheers, Andreas
--
Andreas Dilger
http://www-mddsp.enel.ucalgary.ca/People/adilger/
http://sourceforge.net/projects/ext2resize/
prev parent reply other threads:[~2002-06-10 19:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-06-10 18:09 procedure for creating new ioctl? Joseph Cheek
2002-06-10 18:17 ` Richard B. Johnson
2002-06-10 19:56 ` Andreas Dilger [this message]
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=20020610195610.GO20388@turbolinux.com \
--to=adilger@clusterfs.com \
--cc=joseph@cheek.com \
--cc=linux-kernel@vger.kernel.org \
--cc=root@chaos.analogic.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.