24 .fi
25
26 .SH DESCRIPTION
27 .sp
28 .LP
29 The \fBpipe()\fR and pipe2() functions create an I/O mechanism called a
30 pipe and returns two file descriptors, \fIfildes\fR[\fB0\fR] and
31 \fIfildes\fR[\fB1\fR]. The files associated with \fIfildes\fR[\fB0\fR]
32 and \fIfildes\fR[\fB1\fR] are streams and are both opened for reading and
33 writing. The \fBpipe()\fR call will clear the \fBO_NDELAY\fR,
34 \fBO_NONBLOCK\fR, and \fBFD_CLOEXEC\fR flags on both file descriptors. The
35 \fBfcntl\fR(2) function can be used to set these flags.
36 .sp
37 .LP
38 The \fBpipe2()\fR call will clear the \fBO_NDELAY\fR on both filedescriptors.
39 The \fIflags\fR argument may be used to specify attributes on both file
40 descriptors. \fBpipe2()\fR called with a \fIflags\fR value of 0 will
41 behave identically to \fBpipe()\fR. Values for \fIflags\fR are constructed
42 by a bitwise-inclusive-OR of flags from the following list, defined in
43 <\fBfcntl.h\fR>.
44 .RE
45
46 .sp
47 .ne 2
48 .na
49 \fB\fBO_NONBLOCK\fR\fR
50 .ad
51 .RS 12n
52 Both file descriptors will be placed in non-blocking mode. This corresponds
53 to the \fBO_NONBLOCK\fR flag to \fBfcntl\fR(2).
54 .RE
55
56 .sp
57 .ne 2
58 .na
59 \fB\fBO_CLOEXEC\fR\fR
60 .ad
61 .RS 12n
62 Both file descriptors will be opened with the FD_CLOEXEC flag set. Both file
63 descriptors will be closed prior to any future exec() calls.
64 .RE
|
24 .fi
25
26 .SH DESCRIPTION
27 .sp
28 .LP
29 The \fBpipe()\fR and pipe2() functions create an I/O mechanism called a
30 pipe and returns two file descriptors, \fIfildes\fR[\fB0\fR] and
31 \fIfildes\fR[\fB1\fR]. The files associated with \fIfildes\fR[\fB0\fR]
32 and \fIfildes\fR[\fB1\fR] are streams and are both opened for reading and
33 writing. The \fBpipe()\fR call will clear the \fBO_NDELAY\fR,
34 \fBO_NONBLOCK\fR, and \fBFD_CLOEXEC\fR flags on both file descriptors. The
35 \fBfcntl\fR(2) function can be used to set these flags.
36 .sp
37 .LP
38 The \fBpipe2()\fR call will clear the \fBO_NDELAY\fR on both filedescriptors.
39 The \fIflags\fR argument may be used to specify attributes on both file
40 descriptors. \fBpipe2()\fR called with a \fIflags\fR value of 0 will
41 behave identically to \fBpipe()\fR. Values for \fIflags\fR are constructed
42 by a bitwise-inclusive-OR of flags from the following list, defined in
43 <\fBfcntl.h\fR>.
44
45 .sp
46 .ne 2
47 .na
48 \fB\fBO_NONBLOCK\fR\fR
49 .ad
50 .RS 12n
51 Both file descriptors will be placed in non-blocking mode. This corresponds
52 to the \fBO_NONBLOCK\fR flag to \fBfcntl\fR(2).
53 .RE
54
55 .sp
56 .ne 2
57 .na
58 \fB\fBO_CLOEXEC\fR\fR
59 .ad
60 .RS 12n
61 Both file descriptors will be opened with the FD_CLOEXEC flag set. Both file
62 descriptors will be closed prior to any future exec() calls.
63 .RE
|