Module Name: src Committed By: kamil Date: Fri Nov 27 16:42:00 UTC 2020
Modified Files: src/lib/libc/sys: pipe.2 Log Message: Refine the documentation Sort includes. Correct the historical note, pipe first appeared in AT&T UNIX v3. Document ENOMEM. To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 src/lib/libc/sys/pipe.2 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/libc/sys/pipe.2 diff -u src/lib/libc/sys/pipe.2:1.31 src/lib/libc/sys/pipe.2:1.32 --- src/lib/libc/sys/pipe.2:1.31 Wed Oct 25 17:44:50 2017 +++ src/lib/libc/sys/pipe.2 Fri Nov 27 16:42:00 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: pipe.2,v 1.31 2017/10/25 17:44:50 abhinav Exp $ +.\" $NetBSD: pipe.2,v 1.32 2020/11/27 16:42:00 kamil Exp $ .\" .\" Copyright (c) 1980, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" @(#)pipe.2 8.1 (Berkeley) 6/4/93 .\" -.Dd January 23, 2012 +.Dd November 27, 2020 .Dt PIPE 2 .Os .Sh NAME @@ -42,8 +42,8 @@ .In unistd.h .Ft int .Fn pipe "int fildes[2]" -.In unistd.h .In fcntl.h +.In unistd.h .Ft int .Fn pipe2 "int fildes[2]" "int flags" .Sh DESCRIPTION @@ -59,7 +59,7 @@ The first descriptor connects to the .Em read end of the pipe, and the second connects to the -.Em write end , +.Em write end , so that data written to .Fa fildes[1] appears on (i.e., can be read from) @@ -130,6 +130,8 @@ address violation. Too many descriptors are active. .It Bq Er ENFILE The system file table is full. +.It Bq Er ENOMEM +Not enough kernel memory to establish a pipe. .El .Pp .Fn pipe2 @@ -154,7 +156,11 @@ function conforms to A .Fn pipe function call appeared in -.At v6 . +.At v3 . +Since +.At v4 , +it allocates two distinct file descriptors. +.Pp The .Fn pipe2 function is inspired from Linux and appeared in