diff options
author | Bruce Momjian <bruce@momjian.us> | 2003-08-16 15:35:51 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2003-08-16 15:35:51 +0000 |
commit | edc999b09a7e217d7fe1199faa5f87f4abacf6b3 (patch) | |
tree | 0bcdb3834389114441db4603f297f7048c659a2e /src | |
parent | dcfa89537a7d3fbd5117748c266ff86cd8cfb880 (diff) | |
download | postgresql-edc999b09a7e217d7fe1199faa5f87f4abacf6b3.tar.gz postgresql-edc999b09a7e217d7fe1199faa5f87f4abacf6b3.zip |
Make NEED_REENTRANT_FUNC_NAMES _require_ *_r functions, and add tests to
configure to report if they are not found.
Diffstat (limited to 'src')
-rw-r--r-- | src/include/pg_config.h.in | 9 | ||||
-rw-r--r-- | src/port/thread.c | 9 | ||||
-rw-r--r-- | src/template/bsdi | 1 | ||||
-rw-r--r-- | src/template/freebsd | 4 | ||||
-rw-r--r-- | src/template/linux | 2 | ||||
-rw-r--r-- | src/template/netbsd | 1 | ||||
-rw-r--r-- | src/template/osf | 3 | ||||
-rw-r--r-- | src/template/unixware | 2 |
8 files changed, 10 insertions, 21 deletions
diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in index acb140b856b..2aa62ea8dc5 100644 --- a/src/include/pg_config.h.in +++ b/src/include/pg_config.h.in @@ -118,9 +118,6 @@ /* Define to 1 if you have the `getaddrinfo' function. */ #undef HAVE_GETADDRINFO -/* Define to 1 if you have the `gethostbyname_r' function. */ -#undef HAVE_GETHOSTBYNAME_R - /* Define to 1 if you have the `gethostname' function. */ #undef HAVE_GETHOSTNAME @@ -136,9 +133,6 @@ /* Define to 1 if you have the `getpeereid' function. */ #undef HAVE_GETPEEREID -/* Define to 1 if you have the `getpwuid_r' function. */ -#undef HAVE_GETPWUID_R - /* Define to 1 if you have the `getrusage' function. */ #undef HAVE_GETRUSAGE @@ -378,9 +372,6 @@ /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR -/* Define to 1 if you have the `strerror_r' function. */ -#undef HAVE_STRERROR_R - /* Define to 1 if cpp supports the ANSI # stringizing operator. */ #undef HAVE_STRINGIZE diff --git a/src/port/thread.c b/src/port/thread.c index df06f118c6f..80af433e4ac 100644 --- a/src/port/thread.c +++ b/src/port/thread.c @@ -7,7 +7,7 @@ * * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * - * $Id: thread.c,v 1.3 2003/08/14 05:27:18 momjian Exp $ + * $Id: thread.c,v 1.4 2003/08/16 15:35:51 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -49,7 +49,7 @@ char * pqStrerror(int errnum, char *strerrbuf, size_t buflen) { -#if defined(USE_THREADS) && defined(HAVE_STRERROR_R) +#if defined(USE_THREADS) && defined(NEED_REENTRANT_FUNC_NAMES) /* reentrant strerror_r is available */ /* some early standards had strerror_r returning char * */ strerror_r(errnum, strerrbuf, buflen); @@ -68,7 +68,7 @@ int pqGetpwuid(uid_t uid, struct passwd *resultbuf, char *buffer, size_t buflen, struct passwd **result) { -#if defined(USE_THREADS) && defined(HAVE_GETPWUID_R) +#if defined(USE_THREADS) && defined(NEED_REENTRANT_FUNC_NAMES) /* * Early POSIX draft of getpwuid_r() returns 'struct passwd *'. * getpwuid_r(uid, resultbuf, buffer, buflen) @@ -94,8 +94,7 @@ pqGethostbyname(const char *name, struct hostent **result, int *herrno) { -#if defined(USE_THREADS) && defined(HAVE_GETHOSTBYNAME_R) - +#if defined(USE_THREADS) && defined(NEED_REENTRANT_FUNC_NAMES) /* * broken (well early POSIX draft) gethostbyname_r() which returns * 'struct hostent *' diff --git a/src/template/bsdi b/src/template/bsdi index ec73bc60d07..ab6e92f2f1a 100644 --- a/src/template/bsdi +++ b/src/template/bsdi @@ -12,4 +12,3 @@ esac SUPPORTS_THREADS=yes NEED_REENTRANT_FUNC_NAMES=no - diff --git a/src/template/freebsd b/src/template/freebsd index f35b76a9993..e96e5c2fa55 100644 --- a/src/template/freebsd +++ b/src/template/freebsd @@ -5,13 +5,13 @@ case $host_cpu in esac SUPPORTS_THREADS=yes +NEED_REENTRANT_FUNC_NAMES=no + case $host_os in freebsd2*|freebsd3*|freebsd4*) THREAD_CFLAGS="-pthread" - NEED_REENTRANT_FUNC_NAMES=yes ;; *) THREAD_LIBS="-lc_r" - NEED_REENTRANT_FUNC_NAMES=yes ;; esac diff --git a/src/template/linux b/src/template/linux index fc5c874d844..070e260a276 100644 --- a/src/template/linux +++ b/src/template/linux @@ -1,7 +1,7 @@ CFLAGS=-O2 SUPPORTS_THREADS=yes +NEED_REENTRANT_FUNC_NAMES=yes THREAD_CFLAGS="-D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS" THREAD_LIBS="-lpthread" -NEED_REENTRANT_FUNC_NAMES=yes diff --git a/src/template/netbsd b/src/template/netbsd index c18fccb9bea..9a3869dfe77 100644 --- a/src/template/netbsd +++ b/src/template/netbsd @@ -2,4 +2,3 @@ CFLAGS='-O2 -pipe' SUPPORTS_THREADS=yes NEED_REENTRANT_FUNC_NAMES=no - diff --git a/src/template/osf b/src/template/osf index 8a65f114c55..a930bf4e08e 100644 --- a/src/template/osf +++ b/src/template/osf @@ -4,6 +4,7 @@ else CC="$CC -std" CFLAGS='-O4 -Olimit 2000' fi + SUPPORTS_THREADS=yes +NEED_REENTRANT_FUNC_NAMES=no THREAD_CFLAGS="-pthread" - diff --git a/src/template/unixware b/src/template/unixware index a948761596b..d86e346d8d2 100644 --- a/src/template/unixware +++ b/src/template/unixware @@ -10,5 +10,5 @@ else fi SUPPORTS_THREADS=yes -THREAD_CFLAGS += -D_REENTRANT NEED_REENTRANT_FUNC_NAMES=yes +THREAD_CFLAGS += -D_REENTRANT |