How to determine which pthread, was: Re: last libc_rdependenciesleft on current

Charles Swiger cswiger at
Wed Feb 11 10:58:48 PST 2004

On Feb 11, 2004, at 10:11 AM, Marco van de Voort wrote:
> What does the -D_THREAD_SAFE mean? (I mean does it mean that libc isn't
> thread safe, that it is thread_safe etc etc, or does it interact with 
> the
> C code that is being compiled (the port))

libc generally isn't thread safe.  libc_r (or libpthread, or whatever 
the end result of the current shakeup will be called), is thread-safe.  
The reason for that define is so that the C code you're working on (or 
building via a port) can do different things depending on whether it 
will be single-threaded or whether it needs to be thread-safe.

For example, your code might allocate and use mutexes if -D_THREAD_SAFE 
is defined...


More information about the freebsd-ports mailing list