STREAMS-UX Programmer's Guide (February 2007)
STREAMS IOCTL Commands
Overview
Appendix A
146
The I_PLINK IOCTL can also fail if it is waiting for the multiplexing driver to acknowledge the link request
and an error (M_ERROR) message, or hangup (M_HANGUP) message is received at the stream head for fildes. In
addition, an error can be returned in an M_IOACK or M_IONAK message. When these occur, the I_PLINK fails
with errno set to the value in the message.
I_POP
Removes the module just below the stream head of the stream pointed to by fildes. To remove a module from
a pipe requires that the module was pushed on the side it is being removed from. The arg should be 0 in an
I_POP request.
On failure, errno is set to one of the following values:
[EINVAL] There are not modules in the stream.
[ENXIO] Error value returned by the module being popped.
[ENXIO] A hangup was received on fildes.
I_PUNLINK
Disconnects the two streams specified by fildes and arg that are connected with a persistent link. The
fildes is the file descriptor of the stream connected to the multiplexing driver. The arg is the multiplexor ID
number that was returned by I_PLINK when a stream was linked below the multiplexing driver. If arg is
MUXID_ALL, then all streams which are persistent links to fildes are disconnected. As in I_PLINK, this
command requires the multiplexing driver to acknowledge the unlink.
On failure, 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.
[EAGAIN] Temporarily unable to allocate storage to perform the linking operation.
[EINVAL] The arg is an invalid multiplexor ID number.
[EINVAL] The fildes is the file descriptor of a pipe.
An I_PUNLINK 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 an M_IOCACK or M_IOCNAK message. When these occur, the P_UNLINK IOCTL fails
with errno set to the value in the message.
I_PUSH
Pushes the module whose name is pointed by arg onto the top of the current stream, just below the stream
head. If the stream is a pipe, the module will be inserted between the streams heads of both ends of the pipe.
It then calls the open routine of the newly-pushed module.
On failure, errno is set to one of the following values:
[EINVAL] An invalid module name was used.
[EFAULT] The arg points outside the allocated address space.
[ENXIO] Error value returned by the module being pushed. The push has failed.
[ENXIO] A hangup was received on fildes.