Technical data

streamio(7I) Ioctl Requests SunOS 5.5
NAME streamio STREAMS ioctl commands
SYNOPSIS #include <sys/types.h>
#include <stropts.h>
#include <sys/conf.h>
int ioctl ( int fildes, int command,.../arg/);
DESCRIPTION STREAMS (see intro(2)) ioctl commands are a subset of the ioctl(2) commands, and per-
form a variety of control functions on streams.
fildes is an open file descriptor that refers to a stream. command determines the control
function to be performed as described below. arg represents additional information that
is needed by this command. The type of arg depends upon the command, but it is gen-
erally an integeror a pointer to a command-specific data structure. command and arg are
interpreted by the stream head. Certain combinations of these arguments may be passed
to a module or driver in the stream.
Since theseSTREAMS commands ioctls, they are subject to the errors described in ioctl(2).
In addition to those errors, the call will fail with errno set to EINVAL, without processing
a control function, if the stream referenced by fildes is linked below a multiplexor, or if
command is not a valid value for a stream.
Also, as described in ioctl(2), STREAMS modules and drivers can detect errors. In this
case, the module or driver sends an error message to the stream head containingan error
value. This causes subsequent calls to fail with errno set to this value.
IOCTLS The following ioctl commands, with error values indicated, are applicable to allSTREAMS
files:
I_PUSH Pushes the module whose name is pointed to 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 stream 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 Invalid module name.
EFAULT arg points outside the allocated address space.
ENXIO Open routine of new module failed.
ENXIO Hangup received on fildes.
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. arg should be 0 in an
I_POP request. On failure, errno is set to one of the following values:
EINVAL No module present in the stream.
ENXIO Hangup received on fildes.
7I-326 modified 24 Jan 1995