STREAMS Programming Guide

Open and Close Routines

In the open routine of ptem(7M) a STREAMS message block is allocated for a zero-length message for delivering a hangup message; this allocation of a buffer is done before it is needed to ensure that a buffer is available. An M_SETOPTS message is sent upstream to set the read side Stream head queues, to assign high-water and low-water marks (1024 and 256 respectively), and to establish a controlling terminal.

The same default values as for the line discipline module are assigned to cflags, and INUSE to the state field.

Note -

These default values are currently being examined and may change in the future.

The open routine fails if:

The close routine is called on the last close of the slave side Stream. Pointers to read and write queues are cleared and the buffer for the zero-length message is freed.