[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 Communications Technical Reference, Volume 2

streamio Operations


Perform a variety of control functions on streams.


#include <stropts.h>
int ioctl (fildes, command, arg)
int fildes, command;


See individual streamio operations for a description of each one.


fildes Specifies an open file descriptor that refers to a stream.
command Determines the control function to be performed.
arg Represents additional information that is needed by this operation.

The type of the arg parameter depends upon the operation, but it is generally an integer or a pointer to a command-specific data structure.

The command and arg parameters are passed to the file designated by the fildes parameter and are interpreted by the stream head. Certain combinations of these arguments can be passed to a module or driver in the stream.

Values of the command Parameter

The following ioctl operations are applicable to all STREAMS files:

                          Checks if the current message on the stream-head read queue is marked.
I_CANPUT Checks if a given band is writable.
I_CKBAND Checks if a message of a particular band is on the stream-head queue.
                          Creates a message from user specified buffers, adds information about another stream and sends the message downstream.
I_FIND Compares the names of all modules currently present in the stream to a specified name.
                          Flushes all input or output queues.
                          Flushes all message of a particular band.
                          Gets the band of the first message on the stream-head read queue.
                          Returns the delay time.
                          Returns the events for which the calling process is currently registered to be sent a SIGPOLL signal.
                          Returns the current read mode setting.
I_LINK Connects two specified streams.
I_LIST Lists all the module names on the stream.
                          Retrieves the name of the module just below the stream head.
                          Counts the number of data bytes in data blocks in the first message on the stream-head read queue, and places this value in a specified location.
I_PEEK Allows a user to retrieve the information in the first message on the stream-head read queue without taking the message off the queue.
I_PLINK Connects two specified streams.
                          Removes the module just below the stream head.
                          Disconnects the two specified streams.
                          Pushes a module onto the top of the current stream.
I_RECVFD Retrieves the file descriptor associated with the message sent by an I_SENDFD operation over a stream pipe.
                          Requests a stream to send a message to the stream head at the other end of a stream pipe.
                          Sets the time that the stream head delays when a stream is closing.
                          Informs the stream head that the user wishes the kernel to issue the SIGPOLL signal when a particular event occurs on the stream.
I_SRDOPT Sets the read mode.
I_STR Constructs an internal STREAMS ioctl message.
                          Disconnects the two specified streams.

Return Values

Unless specified otherwise, the return value from the ioctl subroutine is 0 upon success and -1 if unsuccessful with the errno global variable set as indicated.

Implementation Specifics

This operation is part of STREAMS Kernel Extensions.

Related Information

List of Streams Programming References, Understanding streamio (STREAMS ioctl) Operations in AIX Version 4.3 Communications Programming Concepts.

[ Previous | Next | Contents | Glossary | Home | Search ]