summaryrefslogtreecommitdiff
path: root/static/plan9-4e/man3/pipe.3
diff options
context:
space:
mode:
Diffstat (limited to 'static/plan9-4e/man3/pipe.3')
-rw-r--r--static/plan9-4e/man3/pipe.359
1 files changed, 59 insertions, 0 deletions
diff --git a/static/plan9-4e/man3/pipe.3 b/static/plan9-4e/man3/pipe.3
new file mode 100644
index 00000000..fb93fa4d
--- /dev/null
+++ b/static/plan9-4e/man3/pipe.3
@@ -0,0 +1,59 @@
+.TH PIPE 3
+.SH NAME
+pipe \- two-way interprocess communication
+.SH SYNOPSIS
+.B bind #|
+.I dir
+.nf
+
+.IB dir /data
+.IB dir /ctl
+.IB dir /data1
+.IB dir /ctl1
+.fi
+.SH DESCRIPTION
+.PP
+An
+.IR attach (5)
+of this device allocates two new cross-connected I/O streams.
+.B X/data
+and
+.B x/ctl
+are the data and control channels of one stream and
+.B x/data1
+and
+.B x/ctl1
+are the data and control channels of the other stream.
+.PP
+Data written to one channel becomes available for reading at
+the other.
+Write boundaries are preserved: each read terminates
+when the read buffer is full or after reading the last byte
+of a write, whichever comes first.
+.PP
+Writes are atomic up to a certain size, typically 32768 bytes,
+that is, each write will be delivered in a single read by the
+recipient, provided the receiving buffer is large enough.
+.PP
+If there are multiple writers, each
+.I write
+is guaranteed to be available in a contiguous piece at the other
+end of the pipe.
+If there are multiple readers, each read will return data from only
+one write.
+.PP
+The
+.IR pipe (2)
+system call performs an
+.I attach
+of this device and returns file descriptors to the new pipe's
+.B data
+and
+.B data1
+files.
+The files are open with mode
+.BR ORDWR .
+.SH "SEE ALSO"
+.IR pipe (2)
+.SH SOURCE
+.B /sys/src/9/port/devpipe.c