STREAMS-UX Programmer's Guide (February 2007)
STREAMS Mechanism and System Calls
Writing to a Stream
Chapter 2
24
•If priflags is set to 0, a normal message is written to the stream.
• If no control or data part are specified and priflags is set to 0, no message is written. However, putmsg
(2) returns 0, indicating successful completion.
For putpmsg (2), the priflags argument is a bitwise-OR of the mutually exclusive constants, MSG_HIPRI and
MSG_BAND. The priflags and msgband arguments work in conjunction to determine the message priority and
band value. The following points apply to the priflags argument of putmsg(2):
•If priflags is set to 0, putpmsg (2) fails and sets errno.
•If priflags is set to MSG_HIPRI, the control part of the message is present, and msgband is set to 0, a high
priority message will be written.
•If priflags is set to MSG_HIPRI, and either no control part is specified or msgband is set to a non-zero
value, putpmsg (2) fails, and sets errno.
•If priflags is set to MSG_BAND, and the control part of the message is present, a band message will be
written. It is important to set the msgband argument to the desired band priority level. An incorrect band
priority value causes putpmsg (2) to fail with an appropriate errno.
• If no control or data part of the message is specified, and priflags is set to MSG_BAND, no message will be
written, but the function value returned by putpmsg (2) will be 0, indicating successful completion.
Streams Flow Control conditions
Except for the following cases, putmsg (2) and putpmsg (2) will block when the stream is not able to accept
any more messages:
• High priority messages are blocked. They cause the putmsg (2) and putpmsg (2) function calls to fail.
• Non-High priority messages do not block if the O_NONBLOCK flag was set in the open (2) call for the stream.
They cause putmsg (2) and putpmsg (2) to fail.