.TH PIPE 3 
.SH NAME
pipe \- two-way interprocess communication
.SH SYNOPSIS
.nf
.B bind #| x

.B x/data
.B x/ctl
.B x/data1
.B x/ctl1
.fi
.SH DESCRIPTION
.PP
An
.IR attach (5)
of this device allocates two new streams joined at the
device end.
.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
Written data is buffered in kernel stream blocks.
The writer will block once the stream is full, typically after
32768 bytes or 16 writes.
The writer will resume once the stream is less than
half full.
.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
.B ORDWR.
.SH "SEE ALSO"
.IR pipe (2)
