From owner-freebsd-emulation@FreeBSD.ORG Mon Oct 2 17:23:58 2006 Return-Path: X-Original-To: emulation@freebsd.org Delivered-To: freebsd-emulation@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 94E2B16A519; Mon, 2 Oct 2006 17:23:58 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 905E243D95; Mon, 2 Oct 2006 17:23:56 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.6/8.13.6) with ESMTP id k92HNpBx017897; Mon, 2 Oct 2006 13:23:52 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Mon, 2 Oct 2006 12:51:15 -0400 User-Agent: KMail/1.9.1 References: <20061001163532.GA39376@stud.fit.vutbr.cz> In-Reply-To: <20061001163532.GA39376@stud.fit.vutbr.cz> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200610021251.16453.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Mon, 02 Oct 2006 13:23:53 -0400 (EDT) X-Virus-Scanned: ClamAV 0.88.3/1973/Mon Oct 2 11:18:33 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: emulation@freebsd.org, hackers@freebsd.org Subject: Re: filedesc copying in fork() X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2006 17:23:58 -0000 On Sunday 01 October 2006 12:35, Divacky Roman wrote: > hi > > I am trying to implement CLONE_FS in linuxolator clone(). This flags > is used when we want the newly created thread share root/cwd/umask. > > In FreeBSD we have a flags to fork1() RFFDG/RFCFDG. The first one > tells fork1() to copy the filedesc from old proc to the new one. > The later says we should create new filedesc struct. If neither > of these is given the filedesc struct is shared among the processes. > > is my analysis correct? I believe so. > currently in the linuxolator we dont set any of this flags passed to > fork1() ie. doing CLONE_FS semantics on default. > > I am a little confused from linux behaviour because it seems to me > that they dont share open file descriptors betweeen processes after > fork() which is strange. I have no idea on this one. -- John Baldwin