STREAMS-UX Programmer's Guide (February 2007)
STREAMS IOCTL Commands
Overview
Appendix A
141
On failure, errno is set to one of the following values:
[EINVAL] The fildes parameter in the strfdinsert structure is an invalid open file descriptor.
[EINVAL] The size of the pointer plus offset exceeds the value of the len field for the buffer specified
through ctlptr.
[EINVAL] Offset does not specify a properly aligned location in the data buffer.
[EINVAL] Flags contains an undefined value.
[EFAULT] The arg points, or ctrlbuf or databuf is outside the allocated address space.
[EAGAIN] The IOCTL request failed because a non-priority message was to be created, the
O_NONBLOCK option was set, and the stream’s write queue was full because of internal flow
control conditions.
[ENOSR] Buffers could not be allocated for the message that was to be created due to insufficient
STREAMS memory resources.
[ENXIO] A hangup was received on the stream specified by fildes in the I_FDINSERT IOCTL call or
on the stream specified by fildes in the strfdinsert.
[ERANGE] The value of the len field for the buffer specified through databuf does not fall within the
range for the minimum and maximum sizes of packets for the top-most module stream.
[ERANGE] The value of the len field for the buffer specified through databuf is larger than the
maximum allowable size for the data part of a message.
[ERANGE] The value of the len field for the buffer specified through ctlbuf is larger than the
maximum allowable size for the control part of a message.
The I_FDINSERT IOCTL can also fail if an error (M_ERROR) message was received by the
stream specified by the fildes field in the strfdinsert structure. In this case, errno is set
to the error value in the error message.
The I_FDINSERT can also fail if an error message was received by the stream head of the stream
corresponding to fildes in the strfdinsert structure. In this case, errno will be set to the value in the
message.
I_FIND
This command compares the names of all modules currently present on the stream to the name specified in
arg. The command returns a value of 1, if the module is present and a value of 0 (zero) if the module is not
present.
On failure, errno is set to one of the following values:
[EINVAL] The arg does not contain a valid module name.
[EFAULT] The arg points outside the allocated address space.
I_FLUSH
This request flushes all input and/or output queues, depending on the value of arg. Valid arg values are:
FLUSHRW Flush write and read queues.
FLUSHW Flush write queues.
FLUSHR Flush read queues.