From owner-man-jp-reviewer@jp.freebsd.org  Fri May  1 22:59:54 1998
Received: by jaz.jp.freebsd.org (8.8.8+3.0Wbeta7/8.7.3) id WAA05134
	Fri, 1 May 1998 22:59:54 +0900 (JST)
Received: by jaz.jp.freebsd.org (8.8.8+3.0Wbeta7/8.7.3) with ESMTP id WAA05129
	for <man-jp-reviewer@jp.freebsd.org>; Fri, 1 May 1998 22:59:52 +0900 (JST)
Received: from localhost (g92k0323@muse09.mse.waseda.ac.jp [133.9.5.41])
	by pandora.mse.waseda.ac.jp (8.8.8+2.7Wbeta7/3.6W) with ESMTP id WAA24705;
	Fri, 1 May 1998 22:59:50 +0900 (JST)
Message-Id: <199805011359.WAA24705@pandora.mse.waseda.ac.jp>
To: man-jp-reviewer@jp.freebsd.org
cc: g92k0323@mse.waseda.ac.jp
Mime-Version: 1.0 (generated by tm-edit 7.105)
Content-Type: text/plain; charset=ISO-2022-JP
Date: Fri, 01 May 1998 22:59:50 +0900
From: KANOU Hiroki <g92k0323@mse.waseda.ac.jp>
Reply-To: man-jp-reviewer@jp.freebsd.org
Precedence: list
X-Distribute: distribute [version 2.1 (Alpha) patchlevel=24]
X-Sequence: man-jp-reviewer 87
Subject: [man-jp-reviewer 87] fdesc.5
Errors-To: owner-man-jp-reviewer@jp.freebsd.org
Sender: owner-man-jp-reviewer@jp.freebsd.org

$BFC<l$J%U%!%$%k%7%9%F%`$NLu$O$$$/$D$+=P$F$$$^$9$,!"$=$l$i$r(B
$B;2>H$9$kA0$KLu$7$F$7$^$C$?$N$G!"KAF,$NI=8=$K0c$$$,$"$j$^$9!#(B
$B!t86J8$+$i$7$F0c$&$N$+$J!)(B

.\" Copyright (c) 1996
.\"	Mike Pritchard <mpp@FreeBSD.org>.  All rights reserved.
.\"
.\" Copyright (c) 1992, 1993, 1994
.\"	The Regents of the University of California.  All rights reserved.
.\" All rights reserved.
.\"
.\" This code is derived from software donated to Berkeley by
.\" Jan-Simon Pendry.
.\"
.\" 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.
.\"
.\"NAME file descriptor		$B%U%!%$%k5-=R;R(B
.\"NAME augment			(union $B%^%&%s%H$K$h$k(B)$B=E$M9g$o$;(B
.\"
.\"	$Id: fdesc.5,v 1.2.2.1 1997/03/07 04:18:03 mpp Exp $
.\" jpman %Id: fdesc.5,v 0.0 1998/04/24 15:56:32 horikawa Stab %
.\"
.Dd December 14, 1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"$k>l9g$O!"%7%9%F%`%3!<%k8F$S=P$7(B
.Bd -literal -offset indent
fd = open("/dev/fd/0", mode);
.Ed
.Pp
$B$H!"%7%9%F%`%3!<%k8F$S=P$7(B
.Bd -literal -offset indent
fd = fcntl(0, F_DUPFD, 0);
.Ed
.Pp
$B$OEy2A$G$9!#(B
.Pp
$B%U%!%$%k(B
.Pa /dev/stdin ,
.Pa /dev/stdout
$B$*$h$S(B
.Pa /dev/stderr
$B$O(B
.Pa /dev/fd
$B%5%V%G%#%l%/%H%j$NBP1~$9$k%(%s%H%j$X$N%7%s%\%j%C%/%j%s%/$H$J$j$^$9!#(B
$B$3$l$i$r%*!<%W%s$9$k$N$O!"0J2<$N%7%9%F%`%3!<%k8F$S=P$7$HEy2A$G$9!#(B
.Bd -literal -offset indent
fd = fcntl(STDIN_FILENO,  F_DUPFD, 0);
fd = fcntl(STDOUT_FILENO, F_DUPFD, 0);
fd = fcntl(STDERR_FILENO, F_DUPFD, 0);
.Ed
.Pp
.Xr open 2
$B8F$S=P$7;~$N%U%i%0$O(B
.Dv O_RDONLY , 
.Dv O_WRONLY
$B$*$h$S(B
.Dv O_RDWR
$B0J30$OL5;k$5$l$^$9!#(B
.Pp
.Pa /dev/tty
$B%(%s%H%j$O%+%l%s%H%W%m%;%9$N@)8fC<Kv$X$N4V@\;2>H$G$9!#(B
$B$3$l$O8+$+$1>e$OL>A0$D$-%Q%$%W(B (FIFO) $B$G$9$,!"K\J*$N@)8fC<Kv%G%P%$%9$H(B
$BA4$/F1$8?6Iq$$$r$7$^$9!#(B
.Sh $B4XO"%U%!%$%k(B
.Bl -tag -width /dev/stderr -compact
.It Pa /dev/fd/#
.It Pa /dev/stdin
.It Pa /dev/stdout
.It Pa /dev/stderr
.It Pa /dev/tty
.El
.Sh $B4XO"9`L\(B
.Xr tty 4 ,
.Xr mount_devfs 8 ,
.Xr mount_fdesc 8
.Sh $BNr;K(B
.Nm 
$B%U%!%$%k%7%9%F%`$O(B
.Bx 4.4
$B$G:G=i$KEP>l$7$^$7$?!#(B
.Nm
$B%^%K%e%"%k%Z!<%8$O(B
.Fx 2.2
$B$G:G=i$KEP>l$7$^$7$?!#(B
.Sh $B:n<T(B
.Nm
$B%^%K%e%"%k%Z!<%8$O(B Mike Pritchard <mpp@FreeBSD.org>
$B$K$h$C$F=q$+$l$?$b$N$G!"(B Jan-Simon Pendry $B$K$h$k(B
.Xr mount_fdesc 8
$B%^%K%e%"%k%Z!<%8$K4p$E$$$F$$$^$9!#(B
