Re: Not a typewriter

Alexander Viro
2001-05-11T00:08:02Z

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