mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
More thread test program improvements.
This commit is contained in:
@ -6,7 +6,7 @@
|
|||||||
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/tools/thread/thread_test.c,v 1.17 2004/04/21 20:51:54 momjian Exp $
|
* $PostgreSQL: pgsql/src/tools/thread/thread_test.c,v 1.18 2004/04/21 20:58:56 momjian Exp $
|
||||||
*
|
*
|
||||||
* This program tests to see if your standard libc functions use
|
* This program tests to see if your standard libc functions use
|
||||||
* pthread_setspecific()/pthread_getspecific() to be thread-safe.
|
* pthread_setspecific()/pthread_getspecific() to be thread-safe.
|
||||||
@ -139,37 +139,43 @@ defines to your template/$port file before compiling this program.\n\n"
|
|||||||
#ifdef HAVE_STRERROR_R
|
#ifdef HAVE_STRERROR_R
|
||||||
printf("Your system has sterror_r(), so it doesn't use strerror().\n");
|
printf("Your system has sterror_r(), so it doesn't use strerror().\n");
|
||||||
#else
|
#else
|
||||||
printf("Your system uses strerror().\n");
|
printf("Your system uses strerror() which is ");
|
||||||
if (!strerror_threadsafe)
|
if (strerror_threadsafe)
|
||||||
|
printf("thread-safe\n");
|
||||||
|
else
|
||||||
{
|
{
|
||||||
platform_is_threadsafe = false;
|
platform_is_threadsafe = false;
|
||||||
printf("That function is not thread-safe\n");
|
printf("not thread-safe\n");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_GETPWUID_R
|
#ifdef HAVE_GETPWUID_R
|
||||||
printf("Your system has getpwuid_r(), so it doesn't use getpwuid().\n");
|
printf("Your system has getpwuid_r(), so it doesn't use getpwuid().\n");
|
||||||
#else
|
#else
|
||||||
printf("Your system uses getpwuid().\n");
|
printf("Your system uses getpwuid() which is ");
|
||||||
if (!getpwuid_threadsafe)
|
if (getpwuid_threadsafe)
|
||||||
|
printf("thread-safe\n");
|
||||||
|
else
|
||||||
{
|
{
|
||||||
platform_is_threadsafe = false;
|
platform_is_threadsafe = false;
|
||||||
printf("That function is not thread-safe\n");
|
printf("not thread-safe\n");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_GETADDRINFO
|
#ifdef HAVE_GETADDRINFO
|
||||||
printf("Your system has getaddrinfo(), so it doesn't use gethostbyname()\n"
|
printf("Your system has getaddrinfo(), so it doesn't use gethostbyname()\n"
|
||||||
"or gethostbyname_r().\n");
|
" or gethostbyname_r().\n");
|
||||||
#else
|
#else
|
||||||
#ifdef HAVE_GETHOSTBYNAME_R
|
#ifdef HAVE_GETHOSTBYNAME_R
|
||||||
printf("Your system has gethostbyname_r(), so it doesn't use gethostbyname().\n");
|
printf("Your system has gethostbyname_r(), so it doesn't use gethostbyname().\n");
|
||||||
#else
|
#else
|
||||||
printf("Your system uses gethostbyname().\n");
|
printf("Your system uses gethostbyname which is ");
|
||||||
if (!gethostbyname_threadsafe)
|
if (gethostbyname_threadsafe)
|
||||||
|
printf("thread-safe\n");
|
||||||
|
else
|
||||||
{
|
{
|
||||||
platform_is_threadsafe = false;
|
platform_is_threadsafe = false;
|
||||||
printf("That function is not thread-safe\n");
|
printf("not thread-safe\n");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user