STREAMS Programming Guide

Named Streams

The name of a stream or STREAMS–based pipe often associates the stream with an existing node in the file system name space. This allows unrelated processes to open the pipe and exchange data with the application. The following interfaces support naming a stream or STREAMS–based pipe.

fattach(3C)

Attaches a stream file descriptor to a node in the file system name space, thus naming the stream.

fdetach(3C)

Detaches a named stream file descriptor from its node in the file system name space, thus unnaming the stream.

isastream(3C)

Tests whether a file descriptor is associated with a stream.

Named streams are useful for passing file descriptors between unrelated processes on the same machine. A user process can send a file descriptor to another process by invoking the I_SENDFD ioctl(2) on one end of a named stream. This sends a message containing a file pointer to the stream head at the other end of the pipe. Another process can retrieve the message containing the file pointer by an I_RECVFD ioctl(2) call on the other end of the pipe.