From owner-freebsd-arch Mon Oct 8 3:54:27 2001 Delivered-To: freebsd-arch@freebsd.org Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by hub.freebsd.org (Postfix) with ESMTP id C9C8C37B401 for ; Mon, 8 Oct 2001 03:54:24 -0700 (PDT) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.11.6/8.11.6) with ESMTP id f98AqG159661; Mon, 8 Oct 2001 12:52:21 +0200 (CEST) (envelope-from phk@critter.freebsd.dk) To: Doug Rabson Cc: Peter Wemm , Brian Somers , freebsd-arch@FreeBSD.ORG Subject: Re: Cloned open support In-Reply-To: Your message of "Mon, 08 Oct 2001 09:19:49 BST." <20011008091835.X530-100000@salmon.nlsystems.com> Date: Mon, 08 Oct 2001 12:52:16 +0200 Message-ID: <59657.1002538336@critter.freebsd.dk> From: Poul-Henning Kamp Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message <20011008091835.X530-100000@salmon.nlsystems.com>, Doug Rabson write s: >On Mon, 8 Oct 2001, Poul-Henning Kamp wrote: > >> >Doug mentions the hack in dev/streams/streams.c: >> > td->td_dupfd = fd; >> > return ENXIO; >> >.. this is nasty. :-) >> >> This is abuse, it should be rewritten. >> >> >I think the SVR4 clone driver uses something like this. It causes the >> >original namei / open attempt to fail (thus releasing the "common" vnode) >> >and then switching over to the *real* file/vnode at the last minute. >> >> We would have to do that as well in order to unwind the committed vnode >> and select another. > >It might be abuse but its the only way that I know of to keep track of >data per-open-file. I looked at it closer and actually that is a very interesting case: you open a device and return a socket. I don't think this can be done any other way than it is done now. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message