From: Jonathan Lundell <jlundell@pobox.com>
To: Alexander Viro <viro@math.psu.edu>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Not a typewriter
Date: Thu, 10 May 2001 19:01:16 -0700 [thread overview]
Message-ID: <p0510030eb720f425344e@[10.128.7.49]> (raw)
In-Reply-To: <Pine.GSO.4.21.0105102001000.3943-100000@weyl.math.psu.edu>
In-Reply-To: <Pine.GSO.4.21.0105102001000.3943-100000@weyl.math.psu.edu>
At 8:07 PM -0400 2001-05-10, Alexander Viro wrote:
>On Thu, 10 May 2001, Jonathan Lundell wrote:
>
>> ENOTTY is used by several non-serial devices (or file systems) to
>> object to an unrecognized ioctl command. There's also ENOIOCTLCMD
>> (apparently supposed to be a non-user errno, but i don't see where it
>> gets changed to something else) and EINVAL. I'm not sure what the
>> rationale is for choosing among them; perhaps someone would elucidate?
>
>ENOIOCTLCMD is something I've never met in the kernel. Normal reaction
>to unrecognized ioctl() is ENOTTY, for a lot of reasons, starting with
>the fact that ioctls are last-ditch API to be used when you just can't
>think of better one and historically TTY had the earliest (and largest)
>infestation. IOW, "not a tty" used to mean "WTF are you using ioctls here?"
>OTOH, EINVAL is a catch-all thing for "something is wrong with arguments".
That's pretty much what I would have said a couple of hours ago
before grepping the kernel. Try it, though. ENOTTY is rarely used.
ENOIOCTLCMD is all over the damned place, though its comment in
errno.h warns that a user shouldn't see it. And if you browse a bunch
of random ioctl handlers, you'll see EINVAL used for a bad command
much more often than ENOTTY.
FWIW, the comment in errno.h under Solaris 2.6 is "Inappropriate
ioctl for device". I believe that's the POSIX interpretation.
--
/Jonathan Lundell.
next prev parent reply other threads:[~2001-05-11 2:02 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-05-10 23:06 Wayne.Brown
2001-05-10 23:20 ` Hacksaw
2001-05-10 23:52 ` Jonathan Lundell
2001-05-11 0:07 ` Alexander Viro
2001-05-11 2:01 ` Jonathan Lundell [this message]
2001-05-11 9:21 ` Malcolm Beattie
2001-05-11 0:10 ` H. Peter Anvin
2001-05-11 12:25 ` Richard B. Johnson
2001-05-11 1:31 ` David S. Miller
2001-05-11 1:32 ` Blue Lang
2001-05-11 9:31 ` Alan Cox
2001-05-11 9:37 ` Alan Cox
2001-05-15 14:01 ` Anuradha Ratnaweera
-- strict thread matches above, loose matches on Subject: below --
2001-05-14 2:59 Wayne.Brown
2001-05-11 23:57 Bingner Sam J. Contractor RSIS
2001-05-11 23:18 Wayne.Brown
2001-05-14 22:22 ` Kai Henningsen
2001-05-11 18:37 Wayne.Brown
2001-05-11 16:07 Wayne.Brown
2001-05-11 17:03 ` Joel Jaeggli
2001-05-11 21:43 ` Hacksaw
2001-05-13 23:39 ` Mike A. Harris
2001-05-12 4:18 ` John Alvord
2001-05-13 23:35 ` Mike A. Harris
2001-05-14 1:03 ` Horst von Brand
2001-05-14 14:31 ` John Kodis
2001-05-14 15:25 ` Michael Meissner
2001-05-14 17:01 ` Alan Cox
2001-05-14 17:16 ` Michael Meissner
2001-05-14 17:29 ` Jesse Pollard
2001-05-14 18:04 ` H. Peter Anvin
2001-05-14 1:31 ` Jonathan Lundell
2001-05-10 21:42 Richard B. Johnson
2001-05-10 22:38 ` H. Peter Anvin
2001-05-11 7:22 ` Tom Leete
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='p0510030eb720f425344e@[10.128.7.49]' \
--to=jlundell@pobox.com \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@math.psu.edu \
/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®