Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 06 Mar 95 12:05:21 -0800
From:      Bakul Shah <bakul@netcom.com>
To:        davidg@Root.COM
Cc:        current@FreeBSD.org
Subject:   Re: "Text file busy" with program not running anymore? 
Message-ID:  <199503062005.MAA13636@netcom15.netcom.com>
In-Reply-To: Your message of "Sun, 05 Mar 95 13:33:08 PST." <199503052133.NAA00248@corbin.Root.COM>

next in thread | previous in thread | raw e-mail | index | archive | help
>    No. Executed mapped files are a special case. I actually think that the
> "text file busy" thing is generally a hack that should just be removed. I can
> see no valid justification for preventing writes to executing files. If you
> really don't want your executing process(es) to die, then unlinking the file
> first is this the thing to do.

Uhh... forgive me for butting in but ETXTBSY prevents a dumb
mistake from resulting in a disaster.  Imagine doing a ``tar
xvf ...'' that wipes out init or nfsd or something....  Yes,
one should not do this but `expert friendly' should not
imply `dumb user unfriendly'.  ETXTBSY warns you that a
disaster may ensue; removing ETXTBSY will make ia disaster
happen silently.

I can see why one would want to write to a running binary
(debugging, generating code on the fly etc.) but for that
sort of thing surely a TENEX[1] style solution is
preferable?  Namely, the process whose text needs to be
writable gets a distinct image (shared with the original by
copy-on-write) and only the scribbled-on pages are private
to this process.  This also allows two processes to happily
hack in their own different way the `same' shared text (or
shared lib).

Bakul Shah

PS:  I believe a shared lib's readonly portion should also
be treated exactly as text and its refcount be incremented.
In any case, a VTEXT flag is not enough and a count does not
complicate things much.  Youse gotta to do what youse gotta do!

[1] Or was it TWINEX or whatever was that niftier offshoot
    of TENEX called?  It has been years!  Anyway that is
    where I first came across it; undoubtedly there are
    other OSes that do the same thing.



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