1. Clarification: -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT should be
specified explicitly.  During linking, -lpthread should be specified explictly.

   /kristofer

On Mon, 31 Mar 2003, Spinka, Kristofer wrote:

> 1. It's an out of date, and Solaris-biased (as opposed to POISX), man
> page.  Even on Solaris 9.
>
> ====
> http://docs.sun.com/source/816-2454/cc_ops.app.html#pgfId-999925
>
> 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.
>
>    /kristofer
>
> 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
> >
> >
>
>
>

Reply via email to