httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ralf S. Engelschall" <>
Subject Re: Non-threadsafe functions used in threads? (1.3, 2.0)
Date Tue, 05 Oct 1999 07:12:45 GMT

In article <> you wrote:
> On Tue, Sep 28, 1999 at 11:46:20AM +0200, Ralf S. Engelschall wrote:
>> A list of acceptable functions for threaded environments you can find in SUSv2
>> under
>> But, yes, Pthreads doesn't _require_ thread-safe functions unless
>> _POSIX_THREAD_SAFE_FUNCTIONS is defined. This usually means you cannot rely on
>> the existence of thread-safe functions or at least have a own fallback
>> possibility in case _POSIX_THREAD_SAFE_FUNCTIONS is not defined.
> Apparently, there are even two different #defines to indicate this.
> You, Single Unix, and Linux's header files use
> _POSIX_THREAD_SAFE_FUNCTIONS. This O'Reilly pthreads book mentions
> _POSIX_REENTRANT_FUNCTIONS, and the X includes on this machine look
> for both, as I guess we'll have to do.

I've never seen _POSIX_REENTRANT_FUNCTIONS, so it seems to be a non-standard
feature macro. Perhaps from old and now deprecated Pthread drafts, I don't
know. But the main problem still is that if you want to use xx_r() functions
you need a small fallback library for those systems which (legally) do not
provide such functions, i.e.  where the feature test macro indicates they are
not present. When we then also trigger the fallback library for platforms
which even have _POSIX_REENTRANT_FUNCTIONS shouldn't harm. Because if a
platform uses already a non-standard macro I expect that it's xxx_r()
functions are also non-standard. So I personally would ignore
                                       Ralf S. Engelschall

View raw message