From owner-freebsd-current Wed Aug 7 7:32:18 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C2AAD37B400; Wed, 7 Aug 2002 07:32:12 -0700 (PDT) Received: from holly.calldei.com (adsl-208-191-149-232.dsl.hstntx.swbell.net [208.191.149.232]) by mx1.FreeBSD.org (Postfix) with ESMTP id E042343E3B; Wed, 7 Aug 2002 07:32:11 -0700 (PDT) (envelope-from chris@holly.dyndns.org) Received: by holly.calldei.com (Postfix, from userid 1001) id 23581B78; Wed, 7 Aug 2002 09:33:20 -0500 (CDT) Date: Wed, 7 Aug 2002 09:33:20 -0500 From: Chris Costello To: Robert Watson Cc: Christian Weisgerber , freebsd-current@FreeBSD.org Subject: Re: devfs, fdescfs: /dev/fd problems Message-ID: <20020807143319.GA1620@holly.calldei.com> Reply-To: chris@FreeBSD.org References: <20020806185240.GA3138@holly.calldei.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wednesday, August 07, 2002, Robert Watson wrote: > On Tue, 6 Aug 2002, Chris Costello wrote: > > 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. > > Many things found attached to the file table are not vnodes, making the > notion of a vnode from them a little odd. In particular, pipes are not > vnodes, and sockets are not vnodes. :-) Yes, but we do well to make believe that they are just until the process can call open(), which is really just dup() in disguise. They show up as FS entries as well: # ls -l /dev/fd | tee /dev/null total 16 crw------- 1 chris tty 5, 2 Aug 7 09:18 0 p--------- 1 root wheel 0 Aug 7 09:18 1 crw------- 1 chris tty 5, 2 Aug 7 09:18 2 d-w------- 1 chris chris 512 Aug 7 01:16 3 d--------- 1 root wheel 512 Aug 7 01:04 4 (Noting that fstat() on pipes now seems to be broken in that it does not return any file permissions -- IIRC, it used to.) -- Chris Costello 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