Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:24082 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 51951 invoked by uid 1010); 10 Jun 2006 18:15:38 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 51936 invoked from network); 10 Jun 2006 18:15:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Jun 2006 18:15:38 -0000 X-PHP-List-Original-Sender: mba2000@ioplex.com X-Host-Fingerprint: 66.220.1.142 li4-142.members.linode.com Linux 2.4/2.6 Received: from ([66.220.1.142:1785] helo=li4-142.members.linode.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 6C/4D-30619-A4C0B844 for ; Sat, 10 Jun 2006 14:15:38 -0400 Received: from quark.foo.net (c-69-142-196-170.hsd1.nj.comcast.net [69.142.196.170]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by li4-142.members.linode.com (Postfix) with ESMTP id B28EA42C29; Sat, 10 Jun 2006 14:15:33 -0400 (EDT) Date: Sat, 10 Jun 2006 14:14:44 -0400 To: Stefan Esser Cc: internals@lists.php.net Message-ID: <20060610141444.18b9e26b.mba2000@ioplex.com> In-Reply-To: <448AFF00.3090300@php.net> References: <20060610131459.1be2ba20.mba2000@ioplex.com> <448AFF00.3090300@php.net> X-Mailer: Sylpheed version 1.0.6 (GTK+ 1.2.10; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Extension Installer Catch 22 From: mba2000@ioplex.com (Michael B Allen) On Sat, 10 Jun 2006 19:18:56 +0200 Stefan Esser wrote: > Hello Michael, > > I'm writing an extension installer. I want to write the installer in > > PHP. This presents a problem if the extension was previously installed and > > is automatically being loaded because it can segfault after overwriting > > the .so module file. > > > > IIRC, the correct way to replace .so files is to unlink() them first and > then write the new file into place. Bingo. That works perfectly. So 'copy' truncates. If you 'unlink' first you get a new inode and I guess the old module is copy-on-write'd. Thanks, Mike -- Michael B Allen PHP Extension for SSO w/ Windows Group Authorization http://www.ioplex.com/