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


Manual Reference Pages  -  PIPE (3)

NAME

pipe - create an interprocess channel

CONTENTS

Synopsis
Description
Source
See Also
Diagnostics
Bugs

SYNOPSIS

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

int pipe(int fd[2])

DESCRIPTION

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 fork(2) 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, read(3) will return 0 bytes. Writes to a pipe with no reader will generate a note sys: write on closed pipe.

SOURCE

/usr/local/plan9/src/lib9/pipe.c

SEE ALSO

intro(3), read(3)

DIAGNOSTICS

Sets errstr.

BUGS

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 socketpair(2) 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 connect(2) to it. If this functionality is important (as it is for rc(1)), 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


PIPE (3) -->

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