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

Technical Reference: Communications, Volume 2


I_PLINK streamio Operation

Purpose

Connects two specified streams.

Description

The I_PLINK operation is used for connecting multiplexed STREAMS configurations with a permanent link.

The I_PLINK operation connects two streams, where the fildes parameter is the file descriptor of the stream connected to the multiplexing driver, and the arg parameter is the file descriptor of the stream connected to another driver. The stream designated by the arg parameter gets connected by a permanent link below the multiplexing driver. The I_PLINK operation requires the multiplexing driver to send an acknowledgment message to the stream head regarding the linking operation. This call creates a permanent link which can exist even if the file descriptor associated with the upper stream to the multiplexing driver is closed. This call returns a multiplexer ID number (an identifier used to disconnect the multiplexer; see the I_PUNLINK operation) on success, and a value of -1 on failure.

Error Codes

If unsuccessful, the errno global variable is set to one of the following values:

ENXIO Hangup received on the fildes field.
ETIME Time out occurred before acknowledgment message was received at stream head.
EAGAIN Unable to allocate storage to perform the I_PLINK operation.
EBADF The arg parameter is not a valid, open file descriptor.
EINVAL The fildes parameter does not support multiplexing.

OR

The fildes parameter is the file descriptor of a pipe or FIFO.

OR

The arg parameter is not a stream or is already linked under a multiplexer.

OR

The specified link operation would cause a cycle in the resulting configuration; that is, if a given stream head is linked into a multiplexing configuration in more than one place.

An I_PLINK operation can also be unsuccessful while waiting for the multiplexing driver to acknowledge the link request, if a message indicating an error or a hangup is received at the stream head of the fildes parameter. In addition, an error code can be returned in the positive or negative acknowledgment message. For these cases, the I_PLINK operation is unsuccessful with the errno global variable set to the value in the message.

Implementation Specifics

This operation is part of STREAMS Kernel Extensions.

Related Information

The streamio operations.

The I_LINK streamio operation, I_PUNLINK streamio operation.


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