POSIX defines only a very limited subset of the ioctl() functionality associated with STREAMS. Because the STREAMS tool is deprecated, the interface to it is also deprecated on POSIX.
However, ioctl() been part of Unix since then "forever" (it was, of course, in the 7th release of UNIX, and I am confident that it was not new even then). This is the “way” to manage device drivers after they open. The only problem is that such interfaces and controls are not standardized.
You can see the <termios.h> files for a set of functions written for control terminals. I expect a typical implementation to use ioctl() or other similar specialized mechanisms, but the interface was made common when it was standardized (the <termios.h> interface is not identical to any earlier interface, either the 7th edition, or System III or any other interface). If you wanted to, you could write standard functions on top of your ioctl() interface, which your users will use; you must implement these functions to call your ioctl() interface.
So ioctl() does not go away; This is the right way to manage device drivers. POSIX has a slightly different agenda, that's all.
source share