From owner-freebsd-current Wed Jul 4 16:31:57 2001 Delivered-To: freebsd-current@freebsd.org Received: from rhymer.cogsci.ed.ac.uk (rhymer.cogsci.ed.ac.uk [129.215.144.8]) by hub.freebsd.org (Postfix) with ESMTP id 1E40537B403 for ; Wed, 4 Jul 2001 16:31:53 -0700 (PDT) (envelope-from richard@cogsci.ed.ac.uk) Received: from banks.cogsci.ed.ac.uk (banks [129.215.144.55]) by rhymer.cogsci.ed.ac.uk (8.9.3/8.9.3) with ESMTP id AAA14301; Thu, 5 Jul 2001 00:31:35 +0100 (BST) Received: (from richard@localhost) by banks.cogsci.ed.ac.uk (8.9.3+Sun/8.9.3) id AAA12531; Thu, 5 Jul 2001 00:31:35 +0100 (BST) Date: Thu, 5 Jul 2001 00:31:35 +0100 (BST) Message-Id: <200107042331.AAA12531@banks.cogsci.ed.ac.uk> From: Richard Tobin Subject: Re: system and (v)fork To: Peter Jeremy , David Hill In-Reply-To: Peter Jeremy's message of Thu, 05 Jul 2001 08:17:03 +1000 Organization: just say no Cc: freebsd-current@FreeBSD.ORG 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 > vfork(2) [...] The child code > between the fork() and subsequent exec() must be carefully written > because any changes to memory (including stack) or open files will > also be reflected in the parent. Not open files: indeed, the main thing you typically want to do before the exec() is opening, closing and duping files. Stdio FILE structures on the other hand are just like any other memory, so you probably don't want to touch them (hence the warning in the man page to use _exit() rather than exit()). -- Richard To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message