DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

pipe(S)


pipe -- create an interprocess channel

Syntax

cc ... -lc

#include <unistd.h>

int pipe (int fildes[2]);

Description

The pipe system call creates an I/O mechanism called a pipe and returns two file descriptors, fildes[0] and fildes[1]. fildes[0] is opened for reading and fildes[1] is opened for writing.

Up to 5120 bytes of data are buffered by the pipe before the writing process is blocked. A read-only file descriptor fildes[0] accesses the data written to fildes[1] on a first-in-first-out (FIFO) basis.

The pipe system call fails if:


[EMFILE]
The current process has reached the limit of open files.

[ENFILE]
The system file table is full.

[ENODEV]
There is no pipe filesystem.

Diagnostics

Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned, and errno is set to indicate the error.

See also

read(S), sh(C), write(S), fcntl(S), sysi86(S), pipe(ADM)

Standards conformance

pipe is conformant with:

X/Open Portability Guide, Issue 3, 1989 ;
IEEE POSIX Std 1003.1-1990 System Application Program Interface (API) [C Language] (ISO/IEC 9945-1) ;
and NIST FIPS 151-1 .


© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003