Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Dec 2011 16:26:40 +0200
From:      Kostik Belousov <kostikbel@gmail.com>
To:        Dag-Erling Sm??rgrav <des@des.no>
Cc:        kan@freebsd.org, arch@freebsd.org, Xin LI <delphij@gmail.com>
Subject:   Re: fdlopen(3)
Message-ID:  <20111230142640.GO50300@deviant.kiev.zoral.com.ua>
In-Reply-To: <867h1enqyq.fsf@ds4.des.no>
References:  <20111229084308.GD50300@deviant.kiev.zoral.com.ua> <CAGMYy3u6v-Ypo_wJEqWWGgGUjoTr=Ctx6tn6VV4fWM4nTYonrQ@mail.gmail.com> <20111229113829.GF50300@deviant.kiev.zoral.com.ua> <CAGMYy3u7PTEOpf537X5Dbp998zna5Qv5h2-gjwschGDYb%2B2nuQ@mail.gmail.com> <867h1enqyq.fsf@ds4.des.no>

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

--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 <delphij@gmail.com> writes:
> > Kostik Belousov <kostikbel@gmail.com> writes:
> > > Xin LI <delphij@gmail.com> 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--



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