Subject: ENOTTY vs. EOPNOTSUPP vs. ENXIO
To: None <cgd@alpha.bostic.com>
From: Gordon W. Ross <gwr@jericho.mc.com>
List: current-users
Date: 07/12/1994 20:30:09
> Date: Tue, 12 Jul 1994 15:35:31 -0400
> From: "Chris G. Demetriou" <cgd@alpha.bostic.com>
> Actually, it's a bit unclear what the appropriate behaviour is...
Agreed. P1003.1 describes the error codes, but a much more useful
presentation of "what error code should I use for this" is given in
the recommendation 1003.1 N327 by Paul Rabin (3/16/93).
Relevant parts: (sorry, I only have it on paper)
ENOTSUP "Not supported"
Use [it] to indicate that the requested operation, though
supported in general, is not supported by teh implementation
for the requested object or the requested argument.
ENOSYS "Function not implemented"
Use [it] to indicate that the requested operation is not supported
by the implementation for any object or argument.
ENOTTY "Inappropriate I/O control operation"
Use [it] to indicate that an attempt was made to apply an
operation that is meaningful only on tty devices to an object that
is not a tty device.
ENXIO "No such device or address"
Use [it] to indicate taht a referenced hardware device does not
exist or is unavailable, or that the request is out of range for
the device.
Based on these recommendations, I would suggest that the vnode "disk"
driver should return ENOTSUP for the DIOC* ioctls, because the ioctls
indeed are sometimes supported, just not for this object.
Gordon W. Ross Internet: <gwr@mc.com>
Mercury Computer Systems Voice mail: 508-256-0052x295
199 Riverneck Road Front desk: 508-256-1300
Chelmsford, MA 01824-2820 Facsimile: 508-256-3599
------------------------------------------------------------------------------