STREAMS-UX Programmer's Guide (February 2007)

STREAMS IOCTL Commands
Overview
Appendix A
150
[EFAULT] The arg points, or the buffer area specified by ic_dp or ic_len is, outside the allocated
address space.
[ENOSR] Buffers could not be allocated for the IOCTL request because of a lack of STREAMS
memory resources.
[ENXIO] A hangup was received on the stream referred to by fildes.
[ETIME] The IOCTL request timed out before an acknowledgement was received.
The I_STR IOCTL can also fail if the stream head receives a message indicating an error (M_ERROR) or a
hangup (M_HANGUP). In addition, an error can be returned in an M_IOCACK or M_IOCNAK message. In these
cases, the IOCTL fails with errno set to the error value in the message.
I_SWROPT
Sets the write mode using the value of the argument arg. Legal bit settings for arg are:
SNDZERO Sends a zero-length message downstream when a write of 0 bytes occurs. To not send a
zero-length message when a write of 0 bytes occurs, this bit must not be set in arg.
On failure, the errno is set to the following value:
[EINVAL] The arg parameter is an illegal value.
I_UNLINK
Disconnects the two streams specified by fildes and arg.
fildes The file descriptor of the stream connected to the multiplexing driver.
arg The multiplexor ID number that was returned by the I_LINK.
If arg is MUXID_ALL, then all streams which were linked to fildes are disconnected. As in I_LINK, this
command requires the multiplexing driver to acknowledge the unlink.
On failure, the errno is set to one of the following values:
[ENXIO] A hangup was received on fildes.
[ETIME] A timeout occurred before an acknowledgement message was received at the stream head.
[EINVAL] The arg is an invalid multiplexor ID number, or fildes is already linked under a
multiplexing driver.
An I_UNLINK IOCTL can also fail if it is waiting for the multiplexor to acknowledge the unlink request and an
error (M_ERROR) message, or hangup (M_HANGUP) is received at the stream head for fildes. In addition, an
error can be returned in M_IOCACK or M_IOCNAK message. When this occurs, the I_UNLINK IOCTL fails with
errno set to the value in the message.