File:  [Plan 9 NeXT] / lucent / sys / man / 3 / pipe
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 18:01:01 2018 UTC (8 years, 1 month ago) by root
Branches: lucent, MAIN
CVS tags: plan9, HEAD
Plan 9 NeXT

.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 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
.BR ORDWR .
.SH "SEE ALSO"
.IR pipe (2)
.SH SOURCE
.B /sys/src/9/port/devpipe.c

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.