Performs housekeeping during STREAMS driver or module open operations.
#include <pse/mi.h> #include <sys/stream.h>
int mi_open_comm ( StaticPointer, Size, Queue, Device, Flag, SFlag, credp)
The mi_open_comm subroutine performs housekeeping during STREAMS driver or module open operations. It is intended to be called by the driver or module open routine. It assigns a minor device number to the stream (as specified by the SFlag parameter), allocates the requested per-stream data, and sets the q_ptr fields of the stream being opened.
- Each call to the mi_open_comm subroutine must have a corresponding call to the mi_close_comm subroutine. Executing one of these utilities without making a corresponding call to the other will lead to unpredictable results.
- The stream.h header file must be the last included header file of each source file using the stream library.
|StaticPointer||Specifies the address of a static pointer which will be used internally by the mi_open_comm and related utilities to store the address of the module's list of open streams. This pointer should be initialized to NULL.|
|Size||Specifies the amount of memory the module needs for its per-stream data. It is usually the size of the local structure which contains the module's instance data.|
|Queue||Specifies the address of a queue_t structure. The q_ptr field of the of this structure, and of the corresponding read queue structure (if Queue points to a write queue) or write queue structure (if Queue points to a read queue), are filled in with the address of the queue_t structure being initialized.|
|Device||Specifies the address of a dev_t structure. The use of this parameter depends on the value of the SFlag parameter.|
|SFlag||Specifies how the Device parameter is to be used. The
SFlag parameter may take one of the following values:
On successful completion, the
mi_open_comm subroutine returns a value of zero, otherwise one of
the following codes is returned:
|ENXIO||Indicates an invalid parameter.|
|EAGAIN||Indicates that an internal structure could not be allocated, and that the call should be retried.|
The mi_open_comm subroutine is part of STREAMS kernel extensions.
List of Streams Programming References in AIX 5L Version 5.1 Communications Programming Concepts .
STREAMS Overview in AIX 5L Version 5.1 Communications Programming Concepts .
The mi_close_comm subroutine, mi_next_ptr subroutine, mi_bufcall subroutine.