Submitted by: Akira Ikeuchi <a_ikeuchi@mic.mitsumi.co.jp> Reviewed by: Watanabe Kazuhiro <CQG00620@nifty.ne.jp>
115 lines
3.8 KiB
Groff
115 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.21 2004/07/03 22:30:09 ru Exp %
|
|
.\"
|
|
.\" $FreeBSD$
|
|
.Dd June 4, 1993
|
|
.Dt PIPE 2
|
|
.Os
|
|
.Sh ̾¾Î
|
|
.Nm pipe
|
|
.Nd ¥×¥í¥»¥¹´ÖÄÌ¿®¤Î¤¿¤á¤Îµ½Ò»Ò¤Î¥Ú¥¢¤òºîÀ®¤¹¤ë
|
|
.Sh ¥é¥¤¥Ö¥é¥ê
|
|
.Lb libc
|
|
.Sh ½ñ¼°
|
|
.In unistd.h
|
|
.Ft int
|
|
.Fn pipe "int *fildes"
|
|
.Sh ²òÀâ
|
|
.Fn pipe
|
|
¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï
|
|
ÁÐÊý¸þ¤Î¥Ç¡¼¥¿¥Õ¥í¡¼¤ò²Äǽ¤È¤¹¤ë¥ª¥Ö¥¸¥§¥¯¥È¤Ç¤¢¤ë
|
|
.Em pipe
|
|
¤òºîÀ®¤·¡¢¥Ú¥¢¤Î¥Õ¥¡¥¤¥ëµ½Ò»Ò¤ò³ä¤êÅö¤Æ¤Þ¤¹¡£
|
|
.Pp
|
|
´·½¬¤Ë¤è¤ê¡¢Ä̾ï¤Ï 1 ÈÖ¤á¤Îµ½Ò»Ò¤¬¥Ñ¥¤¥×¤Î
|
|
.Em ÆÉ¼è¤ê¦
|
|
¤È¤·¤Æ»ÈÍѤµ¤ì¡¢2 ÈÖ¤á¤Îµ½Ò»Ò¤¬
|
|
.Em ½ñ¹þ¤ß¦
|
|
¤È¤·¤Æ»ÈÍѤµ¤ì¤Þ¤¹¡£
|
|
¤Ç¤¹¤Î¤Ç¡¢
|
|
.Fa fildes[1]
|
|
¤Ë½ñ¤¹þ¤Þ¤ì¤¿¥Ç¡¼¥¿¤¬
|
|
.Fa fildes[0]
|
|
¤Ë¸½¤ì¤Þ¤¹ (¤¹¤Ê¤ï¤Á¡¢
|
|
.Fa fildes[0]
|
|
¤«¤éÆÉ¤ß¼è¤ì¤Þ¤¹)¡£
|
|
¤³¤ì¤ò»È¤¨¤Ð 1 ¤Ä¤Î¥×¥í¥°¥é¥à¤Î½ÐÎϤòÊÌ¤Î¥×¥í¥°¥é¥à¤ËÁ÷¿®¤Ç¤¤Þ¤¹¡£
|
|
Á÷¿®Â¦¤Îɸ½à½ÐÎϤò¥Ñ¥¤¥×¤Î½ñ¹þ¤ß¦¤È¤·¤Æ¥»¥Ã¥È¥¢¥Ã¥×¤·¡¢
|
|
¼õ¿®Â¦¤Îɸ½àÆþÎϤò¥Ñ¥¤¥×¤ÎÆÉ¼è¤ê¦¤È¤·¤Æ¥»¥Ã¥È¥¢¥Ã¥×¤·¤Æ¤¯¤À¤µ¤¤¡£
|
|
¥Ñ¥¤¥×¼«ÂΤϡ¢¤¹¤Ù¤Æ¤ÎÂбþ¤¹¤ëµ½Ò»Ò¤¬¥¯¥í¡¼¥º¤µ¤ì¤ë¤Þ¤Ç»ý³¤·¤Þ¤¹¡£
|
|
.Pp
|
|
°ìü¤¬ÊĤ¸¤Æ¤¤¤ë¥Ñ¥¤¥×¤Ï
|
|
.Em widowed
|
|
(Áê¼ê¤ò¼º¤Ã¤¿) ¤È¸«¤Ê¤µ¤ì¤Þ¤¹¡£
|
|
¤³¤Î¤è¤¦¤Ê¥Ñ¥¤¥×¤Ë½ñ¹þ¤ß¤ò¤¹¤ë¤È¡¢½ñ¹þ¤ß¥×¥í¥»¥¹¤Ï
|
|
.Dv SIGPIPE
|
|
¥·¥°¥Ê¥ë¤ò¼õ¿®¤·¤Þ¤¹¡£
|
|
ÆÉ¼è¤ê¦¤Ë¥Õ¥¡¥¤¥ë¤Î½ªÎ»¤òÅÁ¤¨¤ëÊýË¡¤Ï¡¢
|
|
½ñ¹þ¤ß¦¤Î¥Ñ¥¤¥×¤ò¥¯¥í¡¼¥º¤¹¤ë¤·¤«¤¢¤ê¤Þ¤»¤ó¡£
|
|
ÆÉ¼è¤ê¦¤¬¥Ð¥Ã¥Õ¥¡¤ËÆþ¤Ã¤Æ¤¤¤ë¥Ç¡¼¥¿¤ò»È¤¤Àڤ俸塢Áê¼ê¤ò¼º¤Ã¤¿¥Ñ¥¤¥×¤ò
|
|
ÆÉ¤ß¼è¤ë¤È 0 ¥«¥¦¥ó¥È¤¬ÊÖ¤µ¤ì¤Þ¤¹¡£
|
|
.Pp
|
|
¤³¤Î¥Ñ¥¤¥×¤Î¼ÂÁõ¤Ë¤ª¤±¤ëÁÐÊý¸þ¤È¤¤¤¦À¼Á¤Ï¡¢
|
|
¸Å¤¤¥·¥¹¥Æ¥à¤È¸ß´¹À¤¬¤¢¤ê¤Þ¤»¤ó¡£
|
|
¤Ç¤¹¤Î¤Ç¡¢¥Ñ¥¤¥×¤ò°ìÊý¸þ¤Ë¤·¤«»ÈÍѤ·¤Ê¤¤¤È¤¤Ë¤Ï¡¢
|
|
½¾Íè¤ÎÊýË¡¤ÇüÅÀ¤ò»ÈÍѤ¹¤ë¤³¤Î´·½¬¤Ë½¾¤¦¤³¤È¤ò¤ª´«¤á¤·¤Þ¤¹¡£
|
|
.Sh Ìá¤êÃÍ
|
|
.Rv -std pipe
|
|
.Sh ¥¨¥é¡¼
|
|
.Fn pipe
|
|
¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¼¡¤Î¾ì¹ç¤Ë¼ºÇÔ¤·¤Þ¤¹¡£
|
|
.Bl -tag -width Er
|
|
.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
|
|
¤Ç»ÈÍѤµ¤ì¤Þ¤·¤¿¡£
|