Subject: Re: ioctl and EOPNOTSUPP
To: Ian Zagorskih <ianzag@megasignal.com>
From: David Laight <david@l8s.co.uk>
List: tech-kern
Date: 06/04/2003 23:29:01
> Yes, you are right. At least ioctl(2) description from
> 
> http://www.opengroup.org/onlinepubs/007904975/functions/ioctl.html
> 
> ..says the same just course it's applicible on exactly STREAMs file 
> descriptors. But as far as i understand in NetBSD ioctl() can be called with 
> any fd, no ? It's not required to be STREAMS.

Indeed - which actually means that the errno values aren't defined either.

Posix / X/Open (now TOG) doesn't define ioctl() because it would have
been impossible to get any agreement about what it should do.
However the few STREAMS ioctls are (reasonably) well defined and are
necessary if STREAMS are supported - hence the inclusion of ioctl()
in POSIX.

There ought to be a note that effect of ioctl() on non-STREAMS fds
is 'undefined' (in this case including formating the hard disk!)

I can't remember which working group got STREAMS into posix.
I only know it wasn't the X/Open networking group (XNET).

	David

-- 
David Laight: david@l8s.co.uk