diff options
author | unknown <monty@hundin.mysql.fi> | 2002-05-16 18:20:49 +0300 |
---|---|---|
committer | unknown <monty@hundin.mysql.fi> | 2002-05-16 18:20:49 +0300 |
commit | 4d094257dbb785d792785e610ab3cdf41eae9b8c (patch) | |
tree | 12de711f3f9d8ad9eee9d28cf71e5487f17315d3 /mysys/my_pthread.c | |
parent | 2618c6963c5bf1349c47ce3af6e55213ea9773f4 (diff) | |
parent | 74d29a07712a0caf57fca62dacfeb14b110beca4 (diff) | |
download | mariadb-git-4d094257dbb785d792785e610ab3cdf41eae9b8c.tar.gz |
merge with 3.23.51
BitKeeper/etc/ignore:
auto-union
BitKeeper/etc/logging_ok:
auto-union
BitKeeper/deleted/.del-mysql_fix_extensions.sh:
Delete: scripts/mysql_fix_extensions.sh
Build-tools/Do-rpm:
Auto merged
Makefile.am:
Auto merged
client/mysqldump.c:
Auto merged
client/mysqltest.c:
Auto merged
extra/resolve_stack_dump.c:
Auto merged
include/my_pthread.h:
Auto merged
include/my_sys.h:
Auto merged
include/mysqld_error.h:
Auto merged
innobase/row/row0ins.c:
Auto merged
innobase/row/row0mysql.c:
Auto merged
innobase/row/row0sel.c:
Auto merged
isam/pack_isam.c:
Auto merged
libmysql/libmysql.c:
Auto merged
mysql-test/r/func_if.result:
Auto merged
mysql-test/t/join.test:
Auto merged
mysys/array.c:
Auto merged
mysys/charset.c:
Auto merged
mysys/default.c:
Auto merged
mysys/hash.c:
Auto merged
mysys/my_thr_init.c:
Auto merged
mysys/raid.cc:
Auto merged
mysql-test/t/type_decimal.test:
Auto merged
sql/hostname.cc:
Auto merged
sql/item.h:
Auto merged
sql/item_cmpfunc.h:
Auto merged
sql/item_timefunc.h:
Auto merged
sql/log.cc:
Auto merged
sql/mini_client.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_select.cc:
Auto merged
strings/Makefile.am:
Auto merged
Diffstat (limited to 'mysys/my_pthread.c')
-rw-r--r-- | mysys/my_pthread.c | 75 |
1 files changed, 4 insertions, 71 deletions
diff --git a/mysys/my_pthread.c b/mysys/my_pthread.c index 3a448864b21..209b61159ec 100644 --- a/mysys/my_pthread.c +++ b/mysys/my_pthread.c @@ -23,9 +23,6 @@ #include <m_string.h> #include <thr_alarm.h> #include <assert.h> -#if !defined(MSDOS) && !defined(__WIN__) -#include <netdb.h> -#endif #if (defined(__BSD__) || defined(_BSDI_VERSION)) && !defined(HAVE_mit_thread) #define SCHED_POLICY SCHED_RR @@ -410,70 +407,6 @@ int my_pthread_cond_init(pthread_cond_t *mp, const pthread_condattr_t *attr) #endif -/* Change functions on HP to work according to POSIX */ - -#ifdef HAVE_BROKEN_PTHREAD_COND_TIMEDWAIT -#undef pthread_cond_timedwait - -int my_pthread_cond_timedwait(pthread_cond_t *cond, - pthread_mutex_t *mutex, - struct timespec *abstime) -{ - int error=pthread_cond_timedwait(cond,mutex,abstime); - return error == EAGAIN ? ETIMEDOUT : error; -} -#endif /* HAVE_BROKEN_PTHREAD_COND_TIMEDWAIT */ - -/* - Emulate SOLARIS style calls, not because it's better, but just to make the - usage of getbostbyname_r simpler. -*/ - -#if !defined(my_gethostbyname_r) && defined(HAVE_GETHOSTBYNAME_R) - -#if defined(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE) - -struct hostent *my_gethostbyname_r(const char *name, - struct hostent *result, char *buffer, - int buflen, int *h_errnop) -{ - struct hostent *hp; - DBUG_ASSERT((size_t) buflen >= sizeof(*result)); - if (gethostbyname_r(name,result, buffer, (size_t) buflen, &hp, h_errnop)) - return 0; - return hp; -} - -#elif defined(HAVE_GETHOSTBYNAME_R_RETURN_INT) - -struct hostent *my_gethostbyname_r(const char *name, - struct hostent *result, char *buffer, - int buflen, int *h_errnop) -{ - DBUG_ASSERT(buflen >= sizeof(struct hostent_data)); - if (gethostbyname_r(name,result,(struct hostent_data *) buffer) == -1) - { - *h_errnop= errno; - return 0; - } - return result; -} - -#else - -struct hostent *my_gethostbyname_r(const char *name, - struct hostent *result, char *buffer, - int buflen, int *h_errnop) -{ - struct hostent *hp; - DBUG_ASSERT(buflen >= sizeof(struct hostent_data)); - hp= gethostbyname_r(name,result,(struct hostent_data *) buffer); - *h_errnop= errno; - return hp; -} - -#endif /* GLIBC2_STYLE_GETHOSTBYNAME_R */ -#endif /***************************************************************************** Patches for HPUX @@ -482,10 +415,9 @@ struct hostent *my_gethostbyname_r(const char *name, Note that currently we only remap pthread_ functions used by MySQL. If we are depending on the value for some other pthread_xxx functions, - this has to be added here. -*****************************************************************************/ + this has to be added here -#ifdef HPUX +#if defined(HPUX) || defined(HAVE_BROKEN_PTHREAD_COND_TIMEDWAIT) int my_pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, struct timespec *abstime) @@ -497,8 +429,9 @@ int my_pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, error=ETIMEDOUT; return error; } +#endif - +#ifdef HPUX int my_pthread_mutex_trylock(pthread_mutex_t *mutex) { int error=pthread_mutex_trylock(mutex); |