apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Spinka, Kristofer" <kspi...@style.net>
Subject Re: anybody using Sun's compiler and getting libthread referenced by executables but not libpthread? (fwd)
Date Mon, 31 Mar 2003 21:41:03 GMT
1. It's an out of date, and Solaris-biased (as opposed to POISX), man
page.  Even on Solaris 9.


A.3.42 -mt
Macro option that expands to -D_REENTRANT -lthread. If you are doing your
own multithread coding, you must use this option in the compile and link
steps. To obtain faster execution, this option requires a multiprocessor
system. On a single-processor system, the resulting executable usually
runs more slowly with this option.

2. _POSIX_C_SOURCE=199506L tells the compiler to use POSIX.1c interfaces
as opposed to Solaris (or other) interfaces for symbols that might have the
same name.  I suppose apr/httpd could get by with just
_POSIX_PTHREAD_SEMANTICS, to take care of the threads, but I think it
would be a benefit to be sure that the correct (POISX) sections of the
Solaris header files are being processed.


On Mon, 31 Mar 2003, Jeff Trawick wrote:

> Spinka, Kristofer wrote:
> >   To be sure that the compiler is respecting the POSIX behavior, remove
> > the "-mt" and add "-D_POSIX_C_SOURCE=199506L" and link with -lpthread.
> "man pthread_create" says "cc -mt foo.c -lpthread"
> _POSIX_C_SOURCE=199506L sounds like something to force my program to use
> only those interfaces described in some particular document...  we want
> access to everything the platform offers

View raw message