STREAMS Programming Guide


STREAMS is a general, flexible programming model for UNIX system communication services. STREAMS defines standard interfaces for character input/output (I/O) within the kernel, and between the kernel and the rest of the UNIX system. The mechanism consists of a set of system calls, kernel resources, and kernel routines.

STREAMS lets you create modules to provide standard data communications services and then manipulate the modules on a Stream. From the application level, modules can be dynamically selected and interconnected. No kernel programming, compiling, and link editing are required to create the interconnection.

STREAMS provides an effective environment for kernel services and drivers requiring modularity. STREAMS parallels the layering model found in networking protocols. For example, STREAMS is suitable for:

The fundamental STREAMS unit is the Stream. A Stream is a full-duplex bidirectional data-transfer path between a process in user space and STREAMS driver in kernel space. A Stream has three parts: a Stream head, zero or more modules, and a driver.

Figure 1-1 Simple Stream