Date: Thu, 23 Jan 2003 14:49:33 -0700 (MST) From: "M. Warner Losh" <imp@bsdimp.com> To: eischen@pcnet1.pcnet.com Cc: ben@timing.com, freebsd-arch@FreeBSD.ORG Subject: Re: _REENTRANT in math.h & libm oddities. Message-ID: <20030123.144933.13389746.imp@bsdimp.com> In-Reply-To: <Pine.GSO.4.10.10301231630590.17662-100000@pcnet1.pcnet.com> References: <200301232122.h0NLM31e003077@harmony.village.org> <Pine.GSO.4.10.10301231630590.17662-100000@pcnet1.pcnet.com>
next in thread | previous in thread | raw e-mail | index | archive | help
In message: <Pine.GSO.4.10.10301231630590.17662-100000@pcnet1.pcnet.com> Daniel Eischen <eischen@pcnet1.pcnet.com> writes: : On Thu, 23 Jan 2003, Warner Losh wrote: : : > In message <Pine.GSO.4.10.10301231601440.12720-100000@pcnet1.pcnet.com> Daniel Eischen writes: : > : The gcc manpage is wrong. It should state _REENTRANT instead of : > : _THREAD_SAFE. POSIX specifies that _REENTRANT be defined to get : > : these functions. I know that we always provide implementations : > : of most of these _r functions so it might not make sense to : > : #ifdef them in the header files, but I don't know that always : > : making them visible would be against the spec or cause namespace : > : pollution. : > : > Then FreeBSD's source tree is basically wrong, since it uses : > _THREAD_SAFE for this in many places. But most of them appear to be : > just defining the macro for compiles and such. There's a little bit : > in libc's stdio still, but that's the only significant place that uses : > it in the tree. I'm not sure about out-of-tree software. : : I removed a lot of the _THREAD_SAFE stuff a couple of years ago, : but it wasn't complete removed. -stable might be worse off. In a newish tree it looks like there are only 3 'real' places where we're wrong: find . -type f | xargs egrep _THREAD_SAFE code: ./contrib/ntp/ntpd/refclock_pcf.c:#if defined(_REENTRANT) || defined(_THREAD_SAFE) ./include/rpc/clnt.h:#ifdef _THREAD_SAFE ./include/rpc/clnt.h:#endif /* _THREAD_SAFE */ ./lib/libc_r/sys/uthread_error.c:#ifdef _THREAD_SAFE ./lib/libpthread/sys/thr_error.c:#ifdef _THREAD_SAFE docs or config or false positive: ./contrib/gcc/gcc.1:into user-threaded processes should be compiled with -D_THREAD_SAFE. ./contrib/gcc/gcc.1:-D_THREAD_SAFE. ./contrib/gcc/config/rs6000/aix41.h: %{pthread: -D_THREAD_SAFE}\ ./contrib/gcc/config/rs6000/aix43.h: %{pthread: -D_THREAD_SAFE}\ ./contrib/gcc/config/rs6000/aix43.h: %{pthread: -D_THREAD_SAFE}\ ./contrib/gcc/config/rs6000/aix51.h: %{pthread: -D_THREAD_SAFE}\ ./contrib/gcc/config/rs6000/aix51.h: %{pthread: -D_THREAD_SAFE}\ ./contrib/gcc/gthr-aix.h:#ifdef _THREAD_SAFE ./crypto/heimdal/configure: dpagaix_cflags="-D_THREAD_SAFE -D_AIX_PTHREADS_D7 -D_AIX32_THREADS=1 -D_AES_SOURCE -D_AIX41 -I/usr/include/dce" ./crypto/heimdal/configure.in: dpagaix_cflags="-D_THREAD_SAFE -D_AIX_PTHREADS_D7 -D_AIX32_THREADS=1 -D_AES_SOURCE -D_AIX41 -I/usr/include/dce" ./crypto/openssl/Configure:"FreeBSD-elf", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::-pthread -D_REENTRANT -D_THREAD_SAFE -D_THREADSAFE::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ./crypto/openssl/crypto/rsa/rsa.h:#define RSA_FLAG_THREAD_SAFE 0x10 ./include/unistd.h:#define _POSIX_THREAD_SAFE_FUNCTIONS -1 ./include/unistd.h:#define _SC_THREAD_SAFE_FUNCTIONS 91 /* user */ ./lib/libc/gen/sysconf.c:#if _POSIX_THREAD_SAFE_FUNCTIONS > -1 ./lib/libc/gen/sysconf.c: case _SC_THREAD_SAFE_FUNCTIONS: ./lib/libc/gen/sysconf.c: return (_POSIX_THREAD_SAFE_FUNCTIONS); ./lib/libc_r/Makefile:CFLAGS+=-DPTHREAD_KERNEL -D_THREAD_SAFE ./lib/libmilter/Makefile:CFLAGS+=-D_THREAD_SAFE ./lib/libpthread/Makefile:CFLAGS+=-DPTHREAD_KERNEL -D_THREAD_SAFE ./usr.bin/getconf/sysconf.gperf:_POSIX_THREAD_SAFE_FUNCTIONS, _SC_THREAD_SAFE_FUNCTIONS To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030123.144933.13389746.imp>