|
|
1.1 root 1: .TH PIPE 2
2: .CT 2 comm_proc
3: .SH NAME
4: pipe \(mi create an interprocess channel
5: .SH SYNOPSIS
6: .nf
7: .B int pipe(fildes)
8: .B int fildes[2];
9: .fi
10: .SH DESCRIPTION
11: .I Pipe
12: creates a buffered channel for interprocess I/O communication.
13: Two file descriptors returned in
14: .I fildes
15: are the ends of pair of cross-connected streams;
16: see
17: .IR stream (4).
18: Data written via
19: .B fildes[1]
20: is available for reading via
21: .B fildes[0]
22: and vice versa.
23: .PP
24: After the pipe has been set up,
25: cooperating processes
26: created by subsequent
27: .IR fork (2)
28: calls may pass data through the
29: pipe with
30: .I read
31: and
32: .I write
33: calls.
34: The bytes placed on a pipe
35: by one
36: .I write
37: are contiguous even if many process are writing.
38: .I Writes
39: induce a record structure: a
40: .I read
41: will not return bytes from more than one
42: .IR write ;
43: see
44: .IR read (2).
45: .PP
46: Write calls on a one-ended pipe raise signal
47: .BR SIGPIPE .
48: Read calls on a one-ended pipe with no data in it
49: return an end-of-file for the first several attempts, then raise
50: .BR SIGPIPE ,
51: and eventually
52: .BR SIGKILL .
53: .SH "SEE ALSO"
54: .IR sh (1),
55: .IR fork (2),
56: .IR read (2),
57: .IR select (2),
58: .IR stream (4)
59: .SH DIAGNOSTICS
60: .BR EIO ,
61: .BR EMFILE ,
62: .BR ENFILE ,
63: .BR ENXIO
64: .SH BUGS
65: Buffering in pipes connecting multiple processes may cause deadlocks.
66: .PP
67: Some line discipline modules
68: discard the record delimiters
69: inserted by
70: .IR write .
71: .PP
72: On many other versions of the system,
73: only
74: .B fildes[0]
75: may be read
76: and only
77: .B fildes[1]
78: may be written.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.