.\" @(#)mpxio.5 4.1 (Berkeley) %G%
a record structure on the io stream.
Each record represents data
a control or status message associated with a particular channel.
The prototypical data record read from an mpx file is as follows
specifies the number of characters in
and the record is a control or status message.
the operating system aligns records
on short (i.e. 16\-bit) boundaries
by skipping bytes when necessary.
Data written to an mpx file must be formatted as an array
of record structures defined as follows
where the data portion of the record is referred
to indirectly and the other cells have the same interpretation
control messages listed below may be read from
a multiplexed file descriptor.
They are presented as two 16-bit integers:
the first number is the message code
the second is an optional parameter meaningful
only with M_WATCH, M_BLK, and M_SIG.
a process `wants to attach' on this channel.
The second parameter is the 16-bit
user-id of the process that executed the open.
This message is generated when the last
file descriptor referencing
should be used in response to this message.
indicates logical end of file on a channel.
If the channel is joined to a typewriter,
will cause the M_EOT message
under the conditions specified in
If the channel is attached to a process,
M_EOT will be generated whenever the process
writes zero bytes on the channel.
if non-blocking mode has been enabled on an
.IR "ioctl(xd, MXNBLK, 0)" ,
write operations on the file are truncated in the kernel
when internal queues become full.
This is done on a per-channel basis:
is a count of the number of characters
not transferred to the channel on which
is generated for a channel
after M_BLK when the internal queues have
drained below a threshold.
is generated instead of a normal asynchronous
signal on channels that are joined to typewriters.
The parameter is the signal number.
Two other messages may be generated by the kernel.
As with other messages, the first
16-bit quantity is the message code.
is generated in conjunction with
The uid of the calling process follows the message code
This is followed by a null-terminated string
which is the name of the file being opened.
is generated for a channel connected
when that process executes the
.I "ioctl(fd, cmd, &vec)"
call on the channel file descriptor.
The M_IOCTL code is followed by
the contents of the structure
not needing a better compromise at this time,
.I "sizeof (struct sgttyb)"
Two control messages are understood by the operating system.
M_EOT may be sent through an mpx file to a channel.
It is equivalent to propagating a zero-length record
i.e. the channel is allowed to drain and the process or
device at the other end receives a zero-length
transfer before data starts flowing through the channel again.
M_IOANS can also be sent through a channel to reply to a M_IOCTL.
The format is identical to that received from M_IOCTL.