112 lines
3.8 KiB
Groff
112 lines
3.8 KiB
Groff
.\" Copyright (c) 1980, 1991, 1993
|
||
.\" The Regents of the University of California. All rights reserved.
|
||
.\"
|
||
.\" Redistribution and use in source and binary forms, with or without
|
||
.\" modification, are permitted provided that the following conditions
|
||
.\" are met:
|
||
.\" 1. Redistributions of source code must retain the above copyright
|
||
.\" notice, this list of conditions and the following disclaimer.
|
||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||
.\" notice, this list of conditions and the following disclaimer in the
|
||
.\" documentation and/or other materials provided with the distribution.
|
||
.\" 3. All advertising materials mentioning features or use of this software
|
||
.\" must display the following acknowledgement:
|
||
.\" This product includes software developed by the University of
|
||
.\" California, Berkeley and its contributors.
|
||
.\" 4. Neither the name of the University nor the names of its contributors
|
||
.\" may be used to endorse or promote products derived from this software
|
||
.\" without specific prior written permission.
|
||
.\"
|
||
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||
.\" SUCH DAMAGE.
|
||
.\"
|
||
.\" @(#)pipe.2 8.1 (Berkeley) 6/4/93
|
||
.\" %FreeBSD: src/lib/libc/sys/pipe.2,v 1.7.2.4 1999/08/29 14:49:16 peter Exp %
|
||
.\"
|
||
.Dd June 4, 1993
|
||
.Dt PIPE 2
|
||
.Os BSD 4
|
||
.Sh ̾¾Î
|
||
.Nm pipe
|
||
.Nd ¥×¥í¥»¥¹´ÖÄÌ¿®¤Ë¤Ä¤¤¤Æµ½Ò»Ò¤Î¥Ú¥¢¤òºîÀ®¤¹¤ë
|
||
.Sh ½ñ¼°
|
||
.Fd #include <unistd.h>
|
||
.Ft int
|
||
.Fn pipe "int *fildes"
|
||
.Sh ²òÀâ
|
||
.Fn pipe
|
||
´Ø¿ô¤Ï
|
||
ÁÐÊý¸þ¤Î¥Ç¡¼¥¿¥Õ¥í¡¼¤ò²Äǽ¤È¤¹¤ë¥ª¥Ö¥¸¥§¥¯¥È¤Ç¤¢¤ë
|
||
.Em pipe
|
||
¤òºîÀ®¤·¡¢¥Ú¥¢¤Î¥Õ¥¡¥¤¥ëµ½Ò»Ò¤ò³ä¤êÅö¤Æ¤Þ¤¹¡£
|
||
.Pp
|
||
´·½¬¤Ë¤è¤ê 1 ÈÖ¤á¤Îµ½Ò»Ò¤¬Ä̾¥Ñ¥¤¥×¤Î
|
||
.Em read end
|
||
¤È¤·¤Æ»ÈÍѤµ¤ì¡¢2 ÈÖ¤á¤Îµ½Ò»Ò¤¬Ä̾
|
||
.Em write end
|
||
¤Ê¤Î¤Ç¡¢
|
||
.Fa fildes[1]
|
||
¤Ë½ñ¹þ¤Þ¤ì¤¿¥Ç¡¼¥¿¤¬
|
||
.Fa fildes[0]
|
||
¤Ë¸½¤ì¤Þ¤¹ (¤¹¤Ê¤ï¤Á¡¢
|
||
.Fa fildes[0]
|
||
¤«¤éÆÉ¼è¤ì¤Þ¤¹)¡£
|
||
¤³¤ì¤Ë¤è¤Ã¤Æ 1 ¤Ä¤Î¥×¥í¥°¥é¥à¤Î½ÐÎϤ¬ÊÌ¤Î¥×¥í¥°¥é¥à¤ËÁ÷¿®¤Ç¤¤Þ¤¹¡£
|
||
¥½¡¼¥¹¤Îɸ½à½ÐÎϤϥѥ¤¥×¤Î½ñ¹þ¤ß½ªÃ¼¤Ç¤¢¤ë¤è¤¦¤Ë¥»¥Ã¥È¥¢¥Ã¥×¤µ¤ì¡¢
|
||
¥·¥ó¥¯¤Îɸ½àÆþÎϤϥѥ¤¥×¤ÎÆÉ¼è¤ê½ªÃ¼¤Ç¤¢¤ë¤è¤¦¤Ë¥»¥Ã¥È¥¢¥Ã¥×¤µ¤ì¤Þ¤¹¡£
|
||
¥Ñ¥¤¥×¼«ÂΤϡ¢¤¹¤Ù¤Æ¤ÎÂбþ¤¹¤ëµ½Ò»Ò¤¬ÊĤ¸¤ë¤Þ¤Ç»ý³¤·¤Þ¤¹¡£
|
||
.Pp
|
||
1 ü¤¬ÊĤ¸¤Æ¤¤¤ë¥Ñ¥¤¥×¤Ï
|
||
.Em widowed
|
||
(Áê¼ê¤ò¼º¤Ã¤¿) ¤È¸«¤Ê¤µ¤ì¤Þ¤¹¡£¤³¤Î¤è¤¦¤Ê¥Ñ¥¤¥×¤Ë½ñ¹þ¤ß¤ò¤¹¤ë¤È¡¢
|
||
½ñ¹þ¤ß¥×¥í¥»¥¹¤Ï
|
||
.Dv SIGPIPE
|
||
¿®¹æ¤ò¼õ¿®¤·¤Þ¤¹¡£ÆÉ¼è¤ê¦¤Ë¥Õ¥¡¥¤¥ë¤Î½ªÎ»¤òÅÁ¤¨¤ëÊýË¡¤Ï¡¢
|
||
½ñ¹þ¤ß¦¤Î¥Ñ¥¤¥×¤òÊĤ¸¤Æ¤·¤Þ¤¦¤·¤«¤¢¤ê¤Þ¤»¤ó¡£
|
||
ÆÉ¼è¤ê¦¤¬¥Ð¥Ã¥Õ¥¡¤ËÆþ¤Ã¤Æ¤¤¤ë¥Ç¡¼¥¿¤ò»ÈÍѤ·¤¿¸å¡¢Áê¼ê¤ò¼º¤Ã¤¿¥Ñ¥¤¥×¤ò
|
||
ÆÉ¼è¤ë¤È 0 ¥«¥¦¥ó¥È¤¬ÊÖ¤µ¤ì¤Þ¤¹¡£
|
||
.Pp
|
||
¼ÂÁõ¤·¤¿¥Ñ¥¤¥×¤Î¤³¤ÎÁÐÊý¸þ¤È¤¤¤¦À¼Á¤Ï¸Å¤¤¥·¥¹¥Æ¥à¤Ë¤Ï°Ü¿¢¤Ç¤¤Ê¤¤¤Î¤Ç¡¢
|
||
°ìÊý¸þ¤Ë¥Ñ¥¤¥×¤ò»ÈÍѤ¹¤ë
|
||
¤È¤¤Ï¡¢½¾Íè¤ÎÊýË¡¤ÇüÅÀ¤ò»ÈÍѤ¹¤ë´·½¬¤ò»ÈÍѤ¹¤ë¤³¤È¤ò¤ª´«¤á¤·¤Þ¤¹¡£
|
||
.Sh Ìá¤êÃÍ
|
||
¥Ñ¥¤¥×¤ÎºîÀ®¤¬Àµ¾ï¤Ë´°Î»¤¹¤ë¤È¡¢0 ¤òÊÖ¤·¤Þ¤¹¡£¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¤Ï -1 ¤¬ÊÖ¤µ¤ì¡¢
|
||
¥¨¥é¡¼¤ò¼¨¤¹¤¿¤á¤ËÊÑ¿ô
|
||
.Va errno
|
||
¤¬ÀßÄꤵ¤ì¤Þ¤¹¡£
|
||
.Sh ¥¨¥é¡¼
|
||
.Fn pipe
|
||
¸Æ¤Ó½Ð¤·¤Ï¼¡¤Î¾ì¹ç¤Ë¼ºÇÔ¤·¤Þ¤¹¡£
|
||
.Bl -tag -width [EMFILE]
|
||
.It Bq Er EMFILE
|
||
¥¢¥¯¥Æ¥£¥Ö¤Êµ½Ò»Ò¤¬Â¿¤¹¤®¤Þ¤¹¡£
|
||
.It Bq Er ENFILE
|
||
¥·¥¹¥Æ¥à¥Õ¥¡¥¤¥ë¥Æ¡¼¥Ö¥ë¤¬ËþÇդǤ¹¡£
|
||
.It Bq Er EFAULT
|
||
.Fa fildes
|
||
¥Ð¥Ã¥Õ¥¡¤¬¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤ÎÉÔÀµ¤ÊÎΰè¤Ë¤¢¤ê¤Þ¤¹¡£
|
||
.El
|
||
.Sh ´ØÏ¢¹àÌÜ
|
||
.Xr sh 1 ,
|
||
.Xr fork 2 ,
|
||
.Xr read 2 ,
|
||
.Xr socketpair 2 ,
|
||
.Xr write 2
|
||
.Sh Îò»Ë
|
||
.Fn pipe
|
||
´Ø¿ô¤Ï
|
||
.At v3
|
||
¤ÇÅо줷¤Þ¤·¤¿¡£
|
||
.Pp
|
||
ÁÐÊý¸þ¥Ñ¥¤¥×¤Ï¤Ï¤¸¤á¤Æ
|
||
.At V.4
|
||
¤Ç»ÈÍѤµ¤ì¤Þ¤·¤¿¡£
|