Changed the test for getpwuid_r to exclude those systems (i.e. IRIX), that
authorSebastian Wilhelmi <wilhelmi@ira.uka.de>
Mon, 8 Feb 1999 17:14:44 +0000 (17:14 +0000)
committerSebastian Wilhelmi <wilhelmi@src.gnome.org>
Mon, 8 Feb 1999 17:14:44 +0000 (17:14 +0000)
1999-02-08  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

* configure.in, acconfig.h: Changed the test for getpwuid_r to
exclude those systems (i.e. IRIX), that set ENOSYS after the call.
Test, if pthread_getspecific is posix like or something different,
as on PCThreads.

* gthread/gthread-posix.c (g_private_get_posix_impl): Use the
HAVE_PTHREAD_GETSPECIFIC_POSIX macro to determine, which signature
to use for pthread_getspecific.

12 files changed:
ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
acconfig.h
configure.in
gthread/ChangeLog
gthread/gthread-posix.c

index 860f80a..9493978 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+1999-02-08  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * configure.in, acconfig.h: Changed the test for getpwuid_r to
+       exclude those systems (i.e. IRIX), that set ENOSYS after the call.
+       Test, if pthread_getspecific is posix like or something different,
+       as on PCThreads.        
+
 Sun Feb  7 21:56:00 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gmem.c (g_mem_profile): Copy all elements
index 860f80a..9493978 100644 (file)
@@ -1,3 +1,10 @@
+1999-02-08  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * configure.in, acconfig.h: Changed the test for getpwuid_r to
+       exclude those systems (i.e. IRIX), that set ENOSYS after the call.
+       Test, if pthread_getspecific is posix like or something different,
+       as on PCThreads.        
+
 Sun Feb  7 21:56:00 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gmem.c (g_mem_profile): Copy all elements
index 860f80a..9493978 100644 (file)
@@ -1,3 +1,10 @@
+1999-02-08  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * configure.in, acconfig.h: Changed the test for getpwuid_r to
+       exclude those systems (i.e. IRIX), that set ENOSYS after the call.
+       Test, if pthread_getspecific is posix like or something different,
+       as on PCThreads.        
+
 Sun Feb  7 21:56:00 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gmem.c (g_mem_profile): Copy all elements
index 860f80a..9493978 100644 (file)
@@ -1,3 +1,10 @@
+1999-02-08  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * configure.in, acconfig.h: Changed the test for getpwuid_r to
+       exclude those systems (i.e. IRIX), that set ENOSYS after the call.
+       Test, if pthread_getspecific is posix like or something different,
+       as on PCThreads.        
+
 Sun Feb  7 21:56:00 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gmem.c (g_mem_profile): Copy all elements
index 860f80a..9493978 100644 (file)
@@ -1,3 +1,10 @@
+1999-02-08  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * configure.in, acconfig.h: Changed the test for getpwuid_r to
+       exclude those systems (i.e. IRIX), that set ENOSYS after the call.
+       Test, if pthread_getspecific is posix like or something different,
+       as on PCThreads.        
+
 Sun Feb  7 21:56:00 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gmem.c (g_mem_profile): Copy all elements
index 860f80a..9493978 100644 (file)
@@ -1,3 +1,10 @@
+1999-02-08  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * configure.in, acconfig.h: Changed the test for getpwuid_r to
+       exclude those systems (i.e. IRIX), that set ENOSYS after the call.
+       Test, if pthread_getspecific is posix like or something different,
+       as on PCThreads.        
+
 Sun Feb  7 21:56:00 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gmem.c (g_mem_profile): Copy all elements
index 860f80a..9493978 100644 (file)
@@ -1,3 +1,10 @@
+1999-02-08  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * configure.in, acconfig.h: Changed the test for getpwuid_r to
+       exclude those systems (i.e. IRIX), that set ENOSYS after the call.
+       Test, if pthread_getspecific is posix like or something different,
+       as on PCThreads.        
+
 Sun Feb  7 21:56:00 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gmem.c (g_mem_profile): Copy all elements
index 860f80a..9493978 100644 (file)
@@ -1,3 +1,10 @@
+1999-02-08  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * configure.in, acconfig.h: Changed the test for getpwuid_r to
+       exclude those systems (i.e. IRIX), that set ENOSYS after the call.
+       Test, if pthread_getspecific is posix like or something different,
+       as on PCThreads.        
+
 Sun Feb  7 21:56:00 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gmem.c (g_mem_profile): Copy all elements
index 6b2910e..6c4c1b7 100644 (file)
 #undef HAVE_BROKEN_WCTYPE
 #undef HAVE_DOPRNT
 #undef HAVE_FLOAT_H
+#undef HAVE_GETPWUID_R
+#undef HAVE_GETPWUID_R_POSIX
 #undef HAVE_LIMITS_H
 #undef HAVE_LONG_DOUBLE
 #undef HAVE_POLL
+#undef HAVE_PTHREAD_GETSPECIFIC_POSIX
 #undef HAVE_PWD_H
 #undef HAVE_SYS_PARAM_H
 #undef HAVE_SYS_POLL_H
@@ -92,7 +95,6 @@
 
 #undef G_THREAD_SOURCE
 
-#undef HAVE_GETPWUID_R_POSIX
 /* #undef PACKAGE */
 /* #undef VERSION */
 
index 196dd0b..f27c96b 100644 (file)
@@ -573,12 +573,12 @@ LIBS_NOT_FOUND_1="I can't find the libraries for the thread implementation
 
 LIBS_NOT_FOUND_2=". Please choose another thread implementation or
                provide information on your thread implementation.
-               You can also use the '--disable-threads' flag for configure 
+               You can also run 'configure --disable-threads' 
                to compile without thread support."
 
 FUNC_NO_GETPWUID_R="the 'g_get_(user_name|real_name|home_dir|tmp_dir)'
                functions will not be MT-safe during their first call because
-               there is no 'getpwuid_r' on your system."
+               there is no working 'getpwuid_r' on your system."
 
 FUNC_NO_LOCALTIME_R="the 'g_date_set_time' function will not be MT-safe
                because there is no 'localtime_r' on your system."
@@ -734,7 +734,24 @@ if test x"$have_threads" != xnone; then
        CFLAGS="$CFLAGS $G_THREAD_CFLAGS"
        AC_CHECK_FUNCS(localtime_r rand_r)
        if test "$ac_cv_header_pwd_h" = "yes"; then
-               AC_CHECK_FUNCS(getpwuid_r)
+               AC_MSG_CHECKING([for getpwuid_r])
+               AC_CACHE_VAL(ac_cv_func_getpwuid_r,
+                       [AC_TRY_RUN([#include <errno.h>
+                               int main () { char buffer[10000], *pointer; 
+                               char getpwuid_r (long, void*, void*,
+                                       int, void*);
+                               errno = 0;
+                               getpwuid_r (0, &buffer, &buffer, 
+                                       sizeof (buffer), &pointer);
+                               return errno == ENOSYS;}],
+                               [ac_cv_func_getpwuid_r=yes],
+                               [ac_cv_func_getpwuid_r=no])])
+               if test "$ac_cv_func_getpwuid_r" = yes; then
+                       AC_MSG_RESULT(yes)
+                       AC_DEFINE(HAVE_GETPWUID_R)
+               else
+                       AC_MSG_RESULT(no)
+               fi
                if test "$ac_cv_func_getpwuid_r" = "yes"; then
                        AC_MSG_CHECKING(whether getpwuid_r is posix like)
                        # getpwuid_r(0, NULL, NULL, 0) is the signature on
@@ -748,6 +765,15 @@ if test x"$have_threads" != xnone; then
                                AC_DEFINE(HAVE_GETPWUID_R_POSIX)])
                fi
        fi
+       if test x"$have_threads" = xposix; then
+               AC_MSG_CHECKING(whether pthread_getspecific is posix like)
+               # PCThreads has pthread_getspecific(pthread_key_t, void **);
+               AC_TRY_COMPILE([#include <pthread.h>],
+                       [pthread_getspecific(0,NULL);],
+                       [AC_MSG_RESULT(no)],
+                       [AC_MSG_RESULT(yes)
+                       AC_DEFINE(HAVE_PTHREAD_GETSPECIFIC_POSIX)])
+       fi
        LIBS="$glib_save_LIBS"
        CFLAGS="$glib_save_CFLAGS"
 fi
index c462437..4144266 100644 (file)
@@ -1,3 +1,9 @@
+1999-02-08  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * gthread-posix.c (g_private_get_posix_impl): Use the
+       HAVE_PTHREAD_GETSPECIFIC_POSIX macro to determine, which signature
+       to use for pthread_getspecific.
+
 Tue Jan 19 20:56:02 1999  Tor Lillqvist  <tml@iki.fi>
 
        * Makefile.am (EXTRA_DIST): Added gthread.def.
index e35acbd..33a520a 100644 (file)
@@ -155,8 +155,15 @@ g_private_get_posix_impl (GPrivate * private_key)
 {
   if (!private_key)
     return NULL;
-
+#ifdef HAVE_PTHREAD_GETSPECIFIC_POSIX
   return pthread_getspecific (*(pthread_key_t *) private_key);
+#else /* HAVE_PTHREAD_GETSPECIFIC_POSIX */
+  {
+    void* data;
+    pthread_getspecific (*(pthread_key_t *) private_key, &data);
+    return data;
+  }
+#endif /* HAVE_PTHREAD_GETSPECIFIC_POSIX */
 }
 
 static GThreadFunctions g_thread_functions_for_glib_use_default =