Subject: Re: ENOTTY vs. EOPNOTSUPP vs. ENXIO
To: Chris G. Demetriou <cgd@alpha.bostic.com>
From: Alan Barrett <barrett@daisy.ee.und.ac.za>
List: current-users
Date: 07/12/1994 23:13:11
> Actually, it's a bit unclear what the appropriate behaviour is...

Here's my suggestion:

   ENXIO        "Device not configured".  The device major/minor number
                doesn't make sense (e.g. driver not configured in
                kernel, too few minor numbers configured in kernel, vnd
                device not yet attached to a file).

   EOPNOTSUPP   "Operation not supported".  We know what is wanted, it
                is appropriate for this device, but it's not supported
                yet (e.g. disk labels on vnd devices, file locking in
                NFS).

   ENOTTY       "Inappropriate ioctl for device".  Either we know what
                this request is for and so know that it's inappropriate,
                or we don't know what it's for and so assume that it's
                inappropriate for this class of device.

The above can easily be implemented in the device driver ioctl switches
by having the default case return ENOTTY and having certain specific
cases return EOPNOTSUPP.

> ENXIO is the traditional error return for unsupported
> ioctls()...

My (limited) experience is that ENOTTY is usually used for unsupported
ioctls.

--apb (Alan Barrett)

------------------------------------------------------------------------------