STREAMS Programming Guide

Named Streams

It can be useful to name a stream or STREAMS-based pipe by associating 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.

Passing File Descriptors

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 a I_RECVFD ioctl(2) call on the other end of the pipe.