Skip site navigation (1)Skip section navigation (2)
Date:      07 Jul 1999 10:10:19 +0300
From:      Ville-Pertti Keinonen <will@iki.fi>
To:        zzhang@cs.binghamton.edu (Zhihui Zhang)
Cc:        hackers@freebsd.org
Subject:   Re: Overwrite an executable file that is running
Message-ID:  <86pv25q6jo.fsf@not.demophon.com>
In-Reply-To: zzhang@cs.binghamton.edu's message of "7 Jul 1999 05:11:56 %2B0300"
References:  <Pine.GSO.3.96.990706215025.18513A-100000@sol.cs.binghamton.edu>

next in thread | previous in thread | raw e-mail | index | archive | help

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86pv25q6jo.fsf>