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

I_LINK streamio Operation

Purpose

Connects two specified streams.

Description

The I_LINK operation is used for connecting multiplexed STREAMS configurations.

The I_LINK 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 below the multiplexing driver. The I_LINK operation requires the multiplexing driver to send an acknowledgment message to the stream head regarding the linking operation. This call returns a multiplexer ID number (an identifier used to disconnect the multiplexer; see the I_UNLINK 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 before acknowledgment message was received at stream head.
EAGAIN Temporarily unable to allocate storage to perform the I_LINK operation.
ENOSR Unable to allocate storage to perform the I_LINK operation due to insufficient STREAMS memory resources.
EBADF The arg parameter is not a valid, open file descriptor.
EINVAL 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_LINK operation can also fail 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_LINK operation fails 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_UNLINK streamio operation, I_PLINK streamio operation.


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