From owner-freebsd-hackers Wed Jul 7 0:15:17 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from not.demophon.com (ns.demophon.com [193.65.70.13]) by hub.freebsd.org (Postfix) with ESMTP id 7846E14DA5 for ; Wed, 7 Jul 1999 00:15:01 -0700 (PDT) (envelope-from will@not.demophon.com) Received: (from will@localhost) by not.demophon.com (8.9.3/8.8.7) id KAA16620; Wed, 7 Jul 1999 10:10:20 +0300 (EEST) (envelope-from will) To: zzhang@cs.binghamton.edu (Zhihui Zhang) Cc: hackers@freebsd.org Subject: Re: Overwrite an executable file that is running References: From: Ville-Pertti Keinonen Date: 07 Jul 1999 10:10:19 +0300 In-Reply-To: zzhang@cs.binghamton.edu's message of "7 Jul 1999 05:11:56 +0300" Message-ID: <86pv25q6jo.fsf@not.demophon.com> Lines: 17 X-Mailer: Gnus v5.5/XEmacs 20.4 - "Emerald" Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG zzhang@cs.binghamton.edu (Zhihui Zhang) writes: > For a big executable file that is being run by the OS, all its contents > may not be loaded into the memory. At the same time, the developer gets > impatient and wants to create a new version of the same file. He could > modify the makefile to output the new version to a different file name, > but this is tedious. This new version should not overwrite the older > verion of the file being run. My question is how FreeBSD prevents this > from happening? Can anyone point out for me where in the source code this It is prevented by not allowing it. A file cannot simultaneously be executing and opened for writing. To find the relevant bits in the sources, try: grep ETXTBSY /sys/kern/* To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message