GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
PIPE(3) FreeBSD Library Functions Manual PIPE(3)

pipe - create an interprocess channel

#include <u.h>
#include <libc.h>

int pipe(int fd[2])

Pipe creates a buffered channel for interprocess I/O communication. Two file descriptors are returned in fd. Data written to fd[1] is available for reading from fd[0] and data written to fd[0] is available for reading from fd[1].

After the pipe has been established, cooperating processes created by subsequent calls may pass data through the pipe with read and write calls.

When all the data has been read from a pipe and the writer has closed the pipe or exited, will return 0 bytes. Writes to a pipe with no reader will generate a note sys: write on closed pipe.

/src/lib9/pipe.c

Sets errstr.

If a read or a write of a pipe is interrupted, some unknown number of bytes may have been transferred.

Pipe is a macro defined as p9pipe to avoid name conflicts with Unix's pipe system call.

Unix pipes are not guaranteed to be bidirectional. In order to ensure a bidirectional channel, p9pipe creates Unix domain sockets via the instead of Unix pipes.

The implementation of pipes as Unix domain sockets causes problems with some Unix implementations of /dev/fd, Unix's dup device. If a Unix domain socket is open as file descriptor 0, some implementations disallow the opening of /dev/fd/0; instead one must to it. If this functionality is important (as it is for one must #undef pipe and fall back on the (possibly unidirectional) Unix pipes.


Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.