Subject: Re: ioctl and EOPNOTSUPP
To: Ian Zagorskih <>
From: David Laight <>
List: tech-kern
Date: 06/04/2003 23:29:01
> Yes, you are right. At least ioctl(2) description from
> ..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()

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 Laight: