From owner-freebsd-arch@FreeBSD.ORG Fri Dec 30 14:28:04 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E43C106566B; Fri, 30 Dec 2011 14:28:04 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 032448FC08; Fri, 30 Dec 2011 14:28:03 +0000 (UTC) Received: from alf.home (alf.kiev.zoral.com.ua [10.1.1.177]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id pBUEQeM1028085 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 30 Dec 2011 16:26:40 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from alf.home (kostik@localhost [127.0.0.1]) by alf.home (8.14.5/8.14.5) with ESMTP id pBUEQeeZ021326; Fri, 30 Dec 2011 16:26:40 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by alf.home (8.14.5/8.14.5/Submit) id pBUEQeDn021325; Fri, 30 Dec 2011 16:26:40 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: alf.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 30 Dec 2011 16:26:40 +0200 From: Kostik Belousov To: Dag-Erling Sm??rgrav Message-ID: <20111230142640.GO50300@deviant.kiev.zoral.com.ua> References: <20111229084308.GD50300@deviant.kiev.zoral.com.ua> <20111229113829.GF50300@deviant.kiev.zoral.com.ua> <867h1enqyq.fsf@ds4.des.no> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Ly7k/MJGvmX3BJ+w" Content-Disposition: inline In-Reply-To: <867h1enqyq.fsf@ds4.des.no> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: kan@freebsd.org, arch@freebsd.org, Xin LI Subject: Re: fdlopen(3) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2011 14:28:04 -0000 --Ly7k/MJGvmX3BJ+w Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 30, 2011 at 02:12:29PM +0100, Dag-Erling Sm??rgrav wrote: > Xin LI writes: > > Kostik Belousov writes: > > > Xin LI writes: > > > > Will this prevent e.g. writes to the .so file after open, but > > > > before fdlopen()? > > > How can it ? Even in theory ? > > e.g. process 1 open(), check for permissions, etc., then process 2 > > open() for write, write something, then process proceed with > > fdlopen()? (We do not have mandatory "lock" on file handles to > > prevent writing I think?). >=20 > I think Kostik meant "how could you, even in theory, prevent this from > happening", and the answer is that you can't. Sorry if it was not clear enough. BSD is not SysV, we do not have mandatory locking. Some people consider it a feature. In principle, fdlopen() can take additional argument struct timespec mtim, that would be compared with st_mtim from fstat(2) right before calling constructors from the dso. The passed mtim shall be taken from fstat(2) before the application code starts its checks. But this is completely ridiculous and pointless. Presented use case for fdlopen(3) is valid and useful IMO. --Ly7k/MJGvmX3BJ+w Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk79yiAACgkQC3+MBN1Mb4g5fQCfVOFIgXa/g6S0gJKj2Snc+bZ8 y4QAn1CxDPM3DrF93dhyiJG5GNC2zXJp =R/tZ -----END PGP SIGNATURE----- --Ly7k/MJGvmX3BJ+w--