STREAMS-UX Programmer's Guide (February 2007)
Message Types
Ordinary Messages
Appendix C
240
Ordinary Messages
M_BREAK
This message is sent to a driver to transmit a BREAK on the device controlled by the driver. The message
format for an M_BREAK is defined by the driver developer. This message is never generated from a user
process, and is discarded when received by the stream head. This message may be considered as a special case
of the M_CTL message.
M_CTL
This message (and its corresponding priority counterpart M_PCCTL) is typically used by modules to send
specific information to other modules. The use of this message type is driven by module functionality. This
message is never generated from a user process, and is discarded when received by the stream head.
M_DATA
An M_DATA message contains normal data. It is the default message type for message blocks allocated via the
allocb() function. For messages with multiple message blocks, the message type for all messages following
the first M_DATA block will be M_DATA. In the putmsg (2) and getmsg (2) system calls, the contents of M_DATA
message blocks are referred to as the data part. M_DATA can be sent bi-directionally on a Stream by
STREAMS components as well as a user process.
M_DELAY
This message is sent to a driver to request a real-time delay on output, typically to avoid exceeding the buffer
size of devices (for example, slow terminal devices). M_DELAY can be seen as a special case of the M_CTL
message type, and its usage is developer-dependent. Not all devices may recognize this message. This
message is never generated from a user process, and is discarded if received by the stream head.
M_IOCTL
This message is generated by the stream head in response to I_STR, I_LINK, I_UNLINK, I_PLINK, I_PUNLINK,
and IOCTL calls that are not defined in streamio (7). When the stream head receives one of these IOCTL
calls, it creates an M_IOCTL message by using the values supplied in the ioctl() system call and the process
that issued the IOCTL system call. The M_IOCTL message is then sent downstream.
For an I_STR IOCTL call, the user process sets the
cmd
parameter to I_STR, and the
arg
parameter to a buffer
in the user space of type strioctl. This is defined in <stropts.h> which contains following fields:
int ic_cmd; /* downstream command */
int ic_timout; /* ACK/NAK timeout */
int ic_len; /* length of data arg */
char * ic_dp; /* ptr to data arg */