httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: [?PATCH?] using getpwnam_r in mod_userdir
Date Sat, 11 Nov 2000 00:54:35 GMT

> > Before anybody tells me we can work around these issues, remember that we
> > really have no idea what functions are called internal to the C Run-time,
> > so we can't fix these problems 100%.  If a platform doesn't provide a
> > known thread-safe implementation, then we really can't hack a valid
> > long-term solution.  Imagine the case where both getpwnam and getpwent
> > make a call to the same function within the C run-time, and we have two
> > modules one that calls getpwent and one that calls getpwnam.  We can't
> > protect ourselves from threading issues in that case.  It isn't
> > possible.
> There are certainly theoretical difficulties...  I almost suggested
> something similar+ but I don't know how many folks will find it cool
> to throw out the ability to thread on FreeBSD.

These aren't actual theoretical, they are real issues.  The nice thing
about FreeBSD is that it is open source.  :-)  If people are upset that
the server can't be run in threaded mode, then people can fix the server.

> Are we sure that this won't be an issue for other APR apps too?

It will be an issue.  Even worse, is that other APR apps are potentially
MORE likely to hit these problems, because they are more likely to try to
call thread-unsafe functions when they are threaded.  Because of the
nature of httpd, we are just unlikely to hit these issues too often.  Of
course, anytime you say that, we are garaunteed to hit them.  :-)

> +have APR refuse to configure --with-threads if
> _POSIX_THREAD_SAFE_FUNCTIONS was defined but getpwnam_r() wasn't
> available, and document that getpwnam() better be thread-safe if we
> have threads but no _POSIX_THREAD_SAFE_FUNCTIONS

That's my current opinion, but I am willing to be convinced.


Ryan Bloom               
406 29th St.
San Francisco, CA 94131

View raw message