I_SENDFD streamio Operation

Purpose

Requests a stream to send a message to the stream head at the other end of a stream pipe.

Description

The I_SENDFD operation requests the stream associated with the fildes field to send a message, containing a file pointer, to the stream head at the other end of a stream pipe. The file pointer corresponds to the arg parameter, which must be an integer file descriptor.

The I_SENDFD operation converts the arg parameter into the corresponding system file pointer. It allocates a message block and inserts the file pointer in the block. The user ID and group ID associated with the sending process are also inserted. This message is placed directly on the read queue of the stream head at the other end of the stream pipe to which it is connected.

This operation is part of STREAMS Kernel Extensions.

Error Codes

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

Value Description
EAGAIN The sending stream is unable to allocate a message block to contain the file pointer.
EAGAIN The read queue of the receiving stream head is full and cannot accept the message sent by the I_SENDFD operation.
EBADF The arg parameter is not a valid, open file descriptor.
EINVAL The fildes parameter is not connected to a stream pipe.
ENXIO Hangup received on the fildes parameter.