Sat Feb 22 17:26:41 2014 UTC ()
pipe2 requires fcntl.h for its flags; PR 48614 from Steffen Daode Nurpmeso.
Also fix the wording for EINVAL as suggested by Robert Elz.


(dholland)
diff -r1.29 -r1.30 src/lib/libc/sys/pipe.2

cvs diff -r1.29 -r1.30 src/lib/libc/sys/pipe.2 (expand / switch to unified diff)

--- src/lib/libc/sys/pipe.2 2013/04/23 23:39:13 1.29
+++ src/lib/libc/sys/pipe.2 2014/02/22 17:26:41 1.30
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1.\" $NetBSD: pipe.2,v 1.29 2013/04/23 23:39:13 elric Exp $ 1.\" $NetBSD: pipe.2,v 1.30 2014/02/22 17:26:41 dholland Exp $
2.\" 2.\"
3.\" Copyright (c) 1980, 1991, 1993 3.\" Copyright (c) 1980, 1991, 1993
4.\" The Regents of the University of California. All rights reserved. 4.\" The Regents of the University of California. All rights reserved.
5.\" 5.\"
6.\" Redistribution and use in source and binary forms, with or without 6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions 7.\" modification, are permitted provided that the following conditions
8.\" are met: 8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright 9.\" 1. Redistributions of source code must retain the above copyright
10.\" notice, this list of conditions and the following disclaimer. 10.\" notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\" notice, this list of conditions and the following disclaimer in the 12.\" notice, this list of conditions and the following disclaimer in the
13.\" documentation and/or other materials provided with the distribution. 13.\" documentation and/or other materials provided with the distribution.
14.\" 3. Neither the name of the University nor the names of its contributors 14.\" 3. Neither the name of the University nor the names of its contributors
@@ -31,26 +31,28 @@ @@ -31,26 +31,28 @@
31.\" 31.\"
32.Dd January 23, 2012 32.Dd January 23, 2012
33.Dt PIPE 2 33.Dt PIPE 2
34.Os 34.Os
35.Sh NAME 35.Sh NAME
36.Nm pipe 36.Nm pipe
37.Nd create descriptor pair for interprocess communication 37.Nd create descriptor pair for interprocess communication
38.Sh LIBRARY 38.Sh LIBRARY
39.Lb libc 39.Lb libc
40.Sh SYNOPSIS 40.Sh SYNOPSIS
41.In unistd.h 41.In unistd.h
42.Ft int 42.Ft int
43.Fn pipe "int fildes[2]" 43.Fn pipe "int fildes[2]"
 44.In unistd.h
 45.In fcntl.h
44.Ft int 46.Ft int
45.Fn pipe2 "int fildes[2]" "int flags" 47.Fn pipe2 "int fildes[2]" "int flags"
46.Sh DESCRIPTION 48.Sh DESCRIPTION
47The 49The
48.Fn pipe 50.Fn pipe
49function 51function
50creates a 52creates a
51.Em pipe , 53.Em pipe ,
52which is an object allowing 54which is an object allowing
53unidirectional data flow, 55unidirectional data flow,
54and allocates a pair of file descriptors. 56and allocates a pair of file descriptors.
55The first descriptor connects to the 57The first descriptor connects to the
56.Em read end 58.Em read end
@@ -124,31 +126,27 @@ The reliable detection of this error can @@ -124,31 +126,27 @@ The reliable detection of this error can
124detected, a signal may be delivered to the process, indicating an 126detected, a signal may be delivered to the process, indicating an
125address violation. 127address violation.
126.It Bq Er EMFILE 128.It Bq Er EMFILE
127Too many descriptors are active. 129Too many descriptors are active.
128.It Bq Er ENFILE 130.It Bq Er ENFILE
129The system file table is full. 131The system file table is full.
130.El 132.El
131.Pp 133.Pp
132.Fn pipe2 134.Fn pipe2
133will also fail if: 135will also fail if:
134.Bl -tag -width Er 136.Bl -tag -width Er
135.It Bq Er EINVAL 137.It Bq Er EINVAL
136.Fa flags 138.Fa flags
137is other than 139contains an invalid value.
138.Dv O_NONBLOCK , 
139.Dv O_NOSIGPIPE 
140or 
141.Dv O_CLOEXEC . 
142.El 140.El
143.Sh SEE ALSO 141.Sh SEE ALSO
144.Xr sh 1 , 142.Xr sh 1 ,
145.Xr fork 2 , 143.Xr fork 2 ,
146.Xr read 2 , 144.Xr read 2 ,
147.Xr socketpair 2 , 145.Xr socketpair 2 ,
148.Xr write 2 146.Xr write 2
149.Sh STANDARDS 147.Sh STANDARDS
150The 148The
151.Fn pipe 149.Fn pipe
152function conforms to 150function conforms to
153.St -p1003.1-90 . 151.St -p1003.1-90 .
154.Sh HISTORY 152.Sh HISTORY