summaryrefslogtreecommitdiff
path: root/mysys/my_pthread.c
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2001-12-17 03:02:58 +0200
committerunknown <monty@hundin.mysql.fi>2001-12-17 03:02:58 +0200
commit8f05035c27d876380965b53b4f1b2ab046825c6f (patch)
tree941257314e6e021bd649a4b42156be700895e6a0 /mysys/my_pthread.c
parent565e5cc71de483e9bdf5ff6897c861190125db3e (diff)
downloadmariadb-git-8f05035c27d876380965b53b4f1b2ab046825c6f.tar.gz
Lots of portability fixes.
Fixed shutdown on HPUX. Fixed bug in query cache. Docs/manual.texi: Changelog configure.in: Fixes for HPUX include/m_string.h: Fixes for Purify include/my_pthread.h: Fixes for HPUX include/raid.h: Portability fix. innobase/include/univ.i: Portability fix. mysql-test/mysql-test-run.sh: Added --manual-gdb mysql-test/r/rpl_log.result: Portability fix mysql-test/t/rpl_log.test: Portability fix mysys/my_pthread.c: Portability fix (HPUX) mysys/raid.cc: Portability fix mysys/thr_mutex.c: Portability fix scripts/mysql_install_db.sh: Clean up install message sql-bench/test-alter-table.sh: Fix testsuite sql/ha_innobase.cc: Fixed stack overwrite. sql/log_event.cc: Fixed purify warning sql/mysqld.cc: Added patch from FreeBSD port. Fixed shutdown on HPUX. sql/slave.cc: Cleanup sql/sql_cache.cc: Binary search in 'step' searching Check maximal block in bin Limit of comparasions number in list of memory blocks. Fixed bug in pack() sql/sql_cache.h: Binary search in 'step' searching Check maximal block in bin Limit of comparasions number in list of memory blocks. Fixed bug in pack() sql/sql_parse.cc: Optimize tools/mysqlmanager.c: Portability fix
Diffstat (limited to 'mysys/my_pthread.c')
-rw-r--r--mysys/my_pthread.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/mysys/my_pthread.c b/mysys/my_pthread.c
index aeac95627dd..161e4faaff6 100644
--- a/mysys/my_pthread.c
+++ b/mysys/my_pthread.c
@@ -16,6 +16,7 @@
/* Functions to get threads more portable */
+#define DONT_REMAP_PTHREAD_FUNCTIONS
#include "mysys_priv.h"
#ifdef THREAD
#include <signal.h>
@@ -460,6 +461,27 @@ struct hostent *my_gethostbyname_r(const char *name,
#endif /* GLIBC2_STYLE_GETHOSTBYNAME_R */
#endif
+/*****************************************************************************
+ Patches for HPUX
+ We need these because the pthread_mutex.. code returns -1 on error,
+ instead of the error code.
+
+ 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.
+*****************************************************************************/
+
+int my_pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
+ struct timespec *abstime)
+{
+ int error=pthread_cond_timedwait(cond, mutex, abstime);
+ if (error == -1) /* Safety if the lib is fixed */
+ error=errno;
+ if (error == EAGAIN) /* Correct errno to Posix */
+ error=ETIMEDOUT;
+ return error;
+}
+
/* Some help functions */