|
|
1.1 ! root 1: .TH STREAM 3 ! 2: .SH NAME ! 3: stream \- a structure for communications ! 4: .SH SYNOPSIS ! 5: .B bind ! 6: .I streamdevice ! 7: .I dir ! 8: .nf ! 9: ! 10: .IB dir /data ! 11: .IB dir /ctl ! 12: .fi ! 13: .SH DESCRIPTION ! 14: .PP ! 15: A ! 16: .I stream ! 17: is not a device per se. ! 18: However, many devices use the ! 19: .I streams ! 20: package in the kernel to implement communications channels. ! 21: The properties described here are common to all such channels. ! 22: .PP ! 23: All streams are represented by two standard files, ! 24: .B ctl ! 25: and ! 26: .BR data , ! 27: plus any others the particular device wants to add. ! 28: Reading and writing the ! 29: .B data ! 30: file receives and sends data on the channel. ! 31: If the channel is message oriented, each write ! 32: will represent a message and each read will ! 33: return at most one message. ! 34: If the buffer given in a read is smaller than the message, ! 35: subsequent reads will return the remainder of the message. ! 36: .PP ! 37: Writing textual command strings to the ! 38: .B ctl ! 39: file performs control operations on the stream. ! 40: The strings need not be null-terminated. ! 41: Each device may add to the control operations. ! 42: The common control operations are: ! 43: .TP 14 ! 44: .B hangup ! 45: Hang up this stream. ! 46: Any subsequent writes will return an error. ! 47: The first subsequent read will return 0. ! 48: All following ones will return an error. ! 49: .TP 14 ! 50: .BI push " name ! 51: Push the module ! 52: .I name ! 53: onto the top of the stream. ! 54: .TP 14 ! 55: .B pop ! 56: Pop the top module off the stream ! 57: .LP ! 58: Reading the ! 59: .B ctl ! 60: file returns a textual identifier for the ! 61: stream. ! 62: This is used by multiplexed devices and its use ! 63: is described with the particular device. ! 64: .SH "SEE ALSO" ! 65: .IR pipe (3), ! 66: .IR dk (3), ! 67: .IR cons (3), ! 68: .IR async (3), ! 69: .IR fcall (3), ! 70: .IR ip (3), ! 71: .IR reboot (3) ! 72: .SH SOURCE ! 73: .B /sys/src/9/port/st*.c
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.