[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Technical Reference: Communications, Volume 2


streamio Operations

Purpose

Perform a variety of control functions on streams.

Syntax

#include <stropts.h>

int ioctl (fildes, command, arg)
int fildes, command;

Description

See individual streamio operations for a description of each one.

Parameters


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:

I_ATMARK
                          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.
I_FDINSERT
                          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.
I_FLUSH
                          Flushes all input or output queues.
I_FLUSHBAND
                          Flushes all message of a particular band.
I_GETBAND
                          Gets the band of the first message on the stream-head read queue.
I_GETCLTIME
                          Returns the delay time.
I_GETSIG
                          Returns the events for which the calling process is currently registered to be sent a SIGPOLL signal.
I_GRDOPT
                          Returns the current read mode setting.
I_LINK Connects two specified streams.
I_LIST Lists all the module names on the stream.
I_LOOK
                          Retrieves the name of the module just below the stream head.
I_NREAD
                          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.
I_POP
                          Removes the module just below the stream head.
I_PUNLINK
                          Disconnects the two specified streams.
I_PUSH
                          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.
I_SENDFD
                          Requests a stream to send a message to the stream head at the other end of a stream pipe.
I_SETCLTIME
                          Sets the time that the stream head delays when a stream is closing.
I_SETSIG
                          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.
I_UNLINK
                          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 5L Version 5.1 Communications Programming Concepts.


[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]