Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Aug 2002 13:52:40 -0500
From:      Chris Costello <chris@FreeBSD.org>
To:        Christian Weisgerber <naddy@mips.inka.de>
Cc:        freebsd-current@freebsd.org
Subject:   Re: devfs, fdescfs: /dev/fd problems
Message-ID:  <20020806185240.GA3138@holly.calldei.com>
In-Reply-To: <aim5ad$1tpa$1@kemoauc.mips.inka.de>
References:  <aim5ad$1tpa$1@kemoauc.mips.inka.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On Monday, August 05, 2002, Christian Weisgerber wrote:
> Now let's try a program that lists the directory entries under
> [devfs] /dev/fd:
> 
> $ ./t <( : )
> 0
> 1
> 2

> Listing the entries under [fdescfs] /dev/fd gives something of a surprise:
> 
> $ ./t <( : )
> 0
> 1
> 2
> 3
> 
> The descriptor used by readdir() is there, but the pipe on 63 is
> still missing, although open()ing it obviously works.

   I can't explain why there's even a pipe open on fd #63, but
the reason you're only going to see 0, 1 and 2 is because that's
just how devfs's implementation of /dev/fd works.  The last time
we (phk and I) looked at duplicating the fdescfs code in devfs it
was obvious it would require ugly hacks to get it to work, so it
was decided that devfs would only provide support for
/dev/fd/[0-2] so we can have /dev/std{in,out,err} as symlinks to
them.  fdescfs (should) just export the calling process's file
table as a set of vnodes.

-- 
Chris Costello                                <chris@FreeBSD.org>
FreeBSD Project                           http://www.FreeBSD.org/
TrustedBSD Project                     http://www.TrustedBSD.org/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020806185240.GA3138>