From owner-freebsd-current@FreeBSD.ORG Fri Sep 5 00:38:05 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C27C216A4BF for ; Fri, 5 Sep 2003 00:38:05 -0700 (PDT) Received: from stork.mail.pas.earthlink.net (stork.mail.pas.earthlink.net [207.217.120.188]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0DBAB4400E for ; Fri, 5 Sep 2003 00:38:05 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from user-2ivfjg5.dialup.mindspring.com ([165.247.206.5] helo=mindspring.com) by stork.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 19vBAN-0006ll-00; Fri, 05 Sep 2003 00:38:00 -0700 Message-ID: <3F583D1F.1F8E5B8C@mindspring.com> Date: Fri, 05 Sep 2003 00:37:03 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Paul Richards References: <1062686653.67807.77.camel@localhost> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a4a74375e4b703680fcd2b4a498ac760003ca473d225a0f487350badd9bab72f9c350badd9bab72f9c cc: current@freebsd.org Subject: Re: Text file busy X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2003 07:38:05 -0000 Paul Richards wrote: > Overwriting a file that's currently executing results in a "Text file > busy" error. > > When did this start happening? > > This was something that was fixed way back on FreeBSD but it seems to be > a problem again. You are opening an existing file for write. You need to rename on top of it, or delete and create a new one, and this will not happen. The issue is that the pages in the executing file are not necessarily all in core, so it can't copy-on-write them, since it doesn't know that they are being dirtied. The copy-on-write behaviour is relatively new; old System V and Xenix system did not permit even deleting an executing file, since the process did not hold an open file reference on the file. -- Terry