As part of constructing a Stream, a module can be added (pushed) with an I_PUSH ioctl(2) (see streamio(7I)) call. The push inserts a module beneath the Stream head. Because of the similarity of STREAMS components, the push operation is similar to the driver open.
Each push of a module is independent, even in the same Stream. If the same module is pushed more than once on a Stream, there are multiple occurrences of the module in the Stream. The total number of pushable modules that may be contained on any one Stream is limited by the kernel parameter nstrpush.
An I_POP ioctl(2) (see streamio(7I)) system call removes (pops) the module immediately below the Stream head. The pop calls the module close procedure. On return from the module close, any messages left on the module's message queues are freed (deallocated). Then, the Stream head connects to the component previously below the popped module and releases the module's queue pair. I_PUSH and I_POP enable a user process to dynamically alter the configuration of a Stream by pushing and popping modules as required. For example, a module may be removed and a new one inserted below the Stream head. Then the original module can be pushed back after the new module has been pushed.