?? mpxio.5
字號:
.TH MPXIO 5 .SH NAMEmpxio \- multiplexed i/o.SH SYNOPSIS.B #include <sys/mx.h>.PP.B #include <sgtty.h>.SH DESCRIPTIONData transfers onmpx files(see.IR mpx (2))are multiplexed byimposinga record structure on the io stream.Each record represents datafrom/toa particular channel or a control or status message associated with a particular channel..PPThe prototypical data record read from an mpx file is as follows.PP.in +.5i.nfstruct input_record { short index; short count; short ccount; char data[];};.PP.fiwhere.I indexidentifies the channel,and.I countspecifies the number of characters in.I data.If.I countis zero,.I ccountgives the size of.I data,and the record is a control or status message.Although.I countor.I ccountmight be odd,the operating system aligns recordson short (i.e. 16\-bit) boundariesby skipping bytes when necessary..PPData written to an mpx file must be formatted as an arrayof record structures defined as follows.PP.in +.5i.nfstruct output_record { short index; short count; short ccount; char *data;};.fi.PPwhere the data portion of the record is referredto indirectly and the other cells have the same interpretationas in.I input_record..PPThe control messages listed below may be read froma multiplexed file descriptor.They are presented as two 16-bit integers:the first number is the message code(defined in.IR <sys/mx.h> ),the second is an optional parameter meaningfulonly with M_WATCH and M_BLK..PP.in +1i.ti -.5iM_WATCH \- a process `wants to attach' on this channel.The second parameter is the 16-bit user-id of the process that executed the open..br.ti -.5iM_CLOSE \- the channel is closed.This message is generated when the last file descriptor referencinga channel is closed.The.I detachcommand(see.IR mpx (2)should be used in response to this message..br.ti -.5iM_EOT \- indicates logical end of file on a channel.If the channel is joined to a typewriter,EOT (control-d)will cause the M_EOT message under the conditions specified in.IR tty (4)for end of file.If the channel is attached to a process,M_EOT will be generated whenever the processwrites zero bytes on the channel..br.ti -.5iM_BLK \- if non-blocking mode has been enabled on anmpx file descriptor.I xdby executing.IR "ioctl(xd, MXNBLK, 0)" ,write operations on the file are truncated in the kernelwhen internal queues become full.This is done on a per-channel basis:the parameter is a count of the number of charactersnot transferred to the channel on whichM_BLK is received..br.ti -.5iM_UBLK \- is generated for a channelafter M_BLK when the internal queues havedrained below a threshold..in -1i.PPTwo other messages may be generated by the kernel.As with other messages, the first16-bit quantity is the message code..PP.in +1i.ti -.5iM_OPEN \- is generated in conjunction with `listener' mode (see.IR mpx (2)).The uid of the calling process follows the message codeas with M_WATCH.This is followed by a null-terminated stringwhich is the name of the file being opened..br.ti -.5iM_IOCTL \- is generated for a channel connectedto a processwhen that process executes the.I "ioctl(fd, cmd, &vec)"call on the channel file descriptor.The M_IOCTL code is followed bythe.I cmdargument given to.I ioctlfollowed by the contents of the structure.I vec.It is assumed,not needing a better compromise at this time,that the length of.I vecis determined by.I "sizeof (struct sgttyb)"as declared in.IR <sgtty.h> ..in -1i.PPTwo 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 recordthrough the channel;i.e. the channel is allowed to drain and the process ordevice at the other end receives a zero-lengthtransfer before data starts flowing through the channel again.M_IOCTL can also be sent through a channel.The format is identical to that described above.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -