Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
PIPE.2
Upload User: jnzhq888
Upload Date: 2007-01-18
Package Size: 51694k
Code Size: 2k
Category:
OS Develop
Development Platform:
WINDOWS
- ." Copyright (c) 1980 Regents of the University of California.
- ." All rights reserved. The Berkeley software License Agreement
- ." specifies the terms and conditions for redistribution.
- ."
- ." @(#)pipe.2 6.2 (Berkeley) 8/26/85
- ."
- .TH PIPE 2 "August 26, 1985"
- .UC 4
- .SH NAME
- pipe - create an interprocess communication channel
- .SH SYNOPSIS
- .nf
- .ft B
- #include <unistd.h>
- int pipe(int fIfildesfP[2])
- .fi
- .ft R
- .SH DESCRIPTION
- The
- .B pipe
- system call
- creates an I/O mechanism called a pipe.
- The file descriptors returned can
- be used in read and write operations.
- When the pipe is written using the descriptor
- .IR fildes [1]
- up to PIPE_MAX bytes of data are buffered
- before the writing process is suspended.
- A read using the descriptor
- .IR fildes [0]
- will pick up the data.
- .PP
- PIPE_MAX equals 7168 under Minix, but note that most systems use 4096.
- .PP
- It is assumed that after the
- pipe has been set up,
- two (or more)
- cooperating processes
- (created by subsequent
- .B fork
- calls)
- will pass data through the
- pipe with
- .B read
- and
- .B write
- calls.
- .PP
- The shell has a syntax
- to set up a linear array of processes
- connected by pipes.
- .PP
- Read calls on an empty
- pipe (no buffered data) with only one end
- (all write file descriptors closed)
- returns an end-of-file.
- .PP
- The signal SIGPIPE is generated if a write on a pipe with only one end
- is attempted.
- .SH "RETURN VALUE
- The function value zero is returned if the
- pipe was created; -1 if an error occurred.
- .SH ERRORS
- The fBpipefP call will fail if:
- .TP 15
- [EMFILE]
- Too many descriptors are active.
- .TP 15
- [ENFILE]
- The system file table is full.
- .TP 15
- [ENOSPC]
- The pipe file system (usually the root file system) has no free inodes.
- .TP 15
- [EFAULT]
- The fIfildesfP buffer is in an invalid area of the process's address
- space.
- .SH "SEE ALSO"
- .BR sh (1),
- .BR read (2),
- .BR write (2),
- .BR fork (2).
- .SH NOTES
- Writes may return ENOSPC errors if no pipe data can be buffered, because
- the pipe file system is full.
- .SH BUGS
- Should more than PIPE_MAX bytes be necessary in any
- pipe among a loop of processes, deadlock will occur.