diff options
author | unknown <monty@mashka.mysql.fi> | 2003-01-28 09:02:51 +0200 |
---|---|---|
committer | unknown <monty@mashka.mysql.fi> | 2003-01-28 09:02:51 +0200 |
commit | c97ddd06f4c9eceac9b698f07eb5cc168b1006b6 (patch) | |
tree | bbd008d05f1c1111676b46f092fde8257666d9c2 /include | |
parent | 3595556335b31d908555da9abaa669d3cfcce1e2 (diff) | |
parent | 88b405c4e21162b73077e000a9b8f7ffe9d6d251 (diff) | |
download | mariadb-git-c97ddd06f4c9eceac9b698f07eb5cc168b1006b6.tar.gz |
merge
include/my_sys.h:
Auto merged
sql/item_create.cc:
Auto merged
sql/log.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/set_var.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
innobase/btr/btr0cur.c:
Use local file
scripts/make_binary_distribution.sh:
Add mysql_waitpid
sql/mysqld.cc:
Simple cleanup
Diffstat (limited to 'include')
-rw-r--r-- | include/Makefile.am | 2 | ||||
-rw-r--r-- | include/config-netware.h | 86 | ||||
-rw-r--r-- | include/config-win.h | 3 | ||||
-rw-r--r-- | include/my_global.h | 19 | ||||
-rw-r--r-- | include/my_net.h | 2 | ||||
-rw-r--r-- | include/my_pthread.h | 38 | ||||
-rw-r--r-- | include/my_sys.h | 43 | ||||
-rw-r--r-- | include/mysql.h | 11 |
8 files changed, 174 insertions, 30 deletions
diff --git a/include/Makefile.am b/include/Makefile.am index 077ec3c9017..7a02b38020d 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -22,7 +22,7 @@ pkginclude_HEADERS = dbug.h m_string.h my_sys.h my_list.h \ errmsg.h my_global.h my_net.h my_alloc.h \ my_getopt.h sslopt-longopts.h \ sslopt-vars.h sslopt-case.h $(BUILT_SOURCES) -noinst_HEADERS = config-win.h config-os2.h \ +noinst_HEADERS = config-win.h config-os2.h config-netware.h \ nisam.h heap.h merge.h my_bitmap.h\ myisam.h myisampack.h myisammrg.h ft_global.h\ my_dir.h mysys_err.h my_base.h \ diff --git a/include/config-netware.h b/include/config-netware.h new file mode 100644 index 00000000000..57bf500da47 --- /dev/null +++ b/include/config-netware.h @@ -0,0 +1,86 @@ +/* Copyright (C) 2000 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Defines for netware compatible with MySQL */ + +/* required headers */ +#include <unistd.h> +#include <stdio.h> +#include <errno.h> +#include <screen.h> +#include <limits.h> +#include <nks/synch.h> +#include <nks/thread.h> +#include <signal.h> +#include <errno.h> +#include <stdbool.h> +#include <stdlib.h> +#include <nks/errno.h> +#include <sys/types.h> +#include <time.h> +#include <sys/time.h> +#include <nks/time.h> +#include <pthread.h> +#include <termios.h> + +/* required adjustments */ +#undef HAVE_READDIR_R +#undef HAVE_RWLOCK_INIT +#undef HAVE_SCHED_H +#undef HAVE_SYS_MMAN_H +#undef HAVE_SYNCH_H +#undef HAVE_CRYPT +#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1 +#define HAVE_PTHREAD_SIGMASK 1 +#define HAVE_PTHREAD_YIELD_ZERO_ARG 1 +#define HAVE_BROKEN_REALPATH 1 + +/* no case sensitivity */ +#define FN_NO_CASE_SENCE 1 + +/* the thread alarm is not used */ +#define DONT_USE_THR_ALARM 1 + +/* signals do not interrupt sockets */ +#define SIGNALS_DONT_BREAK_READ 1 + +/* signal by closing the sockets */ +#define SIGNAL_WITH_VIO_CLOSE 1 + +/* default directory information */ +#define DEFAULT_MYSQL_HOME "sys:/mysql" +#define PACKAGE "mysql" +#define DEFAULT_BASEDIR "sys:/" +#define SHAREDIR "share/" +#define DEFAULT_CHARSET_HOME "sys:/mysql/" +#define DATADIR "data/" + +/* 64-bit file system calls */ +#define SIZEOF_OFF_T 8 +#define off_t off64_t +#define chsize chsize64 +#define ftruncate ftruncate64 +#define lseek lseek64 +#define pread pread64 +#define pwrite pwrite64 +#define tell tell64 + +/* do not use the extended time in LibC sys\stat.h */ +#define _POSIX_SOURCE + +/* Some macros for portability */ + +#define set_timespec(ABSTIME,SEC) { (ABSTIME).tv_sec=(SEC); (ABSTIME).tv_nsec=0; } diff --git a/include/config-win.h b/include/config-win.h index 5bdede86a9e..b4b9a59a067 100644 --- a/include/config-win.h +++ b/include/config-win.h @@ -182,6 +182,8 @@ inline double ulonglong2double(ulonglong value) #define tell(A) _telli64(A) #endif +#define set_timespec(ABSTIME,SEC) { (ABSTIME).tv_sec=time((time_t*)0) + (time_t) (SEC); (ABSTIME).tv_nsec=0; } + #define STACK_DIRECTION -1 /* Optimized store functions for Intel x86 */ @@ -276,6 +278,7 @@ inline double ulonglong2double(ulonglong value) #define my_reinterpret_cast(A) reinterpret_cast <A> #define my_const_cast(A) const_cast<A> + /* MYSQL OPTIONS */ #ifdef _CUSTOMCONFIG_ diff --git a/include/my_global.h b/include/my_global.h index 3b66b3cbc16..a360947e42d 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -51,6 +51,12 @@ #include <config-win.h> #elif defined(OS2) #include <config-os2.h> +#elif defined(__NETWARE__) +#include <my_config.h> +#include <config-netware.h> +#if defined(__cplusplus) && defined(inline) +#undef inline /* fix configure problem */ +#endif #else #include <my_config.h> #if defined(__cplusplus) && defined(inline) @@ -442,17 +448,20 @@ typedef SOCKET_SIZE_TYPE size_socket; /* file create flags */ -#ifndef O_SHARE +#ifndef O_SHARE /* Probably not windows */ #define O_SHARE 0 /* Flag to my_open for shared files */ #ifndef O_BINARY #define O_BINARY 0 /* Flag to my_open for binary files */ #endif -#define FILE_BINARY 0 /* Flag to my_fopen for binary streams */ +#ifndef FILE_BINARY +#define FILE_BINARY O_BINARY /* Flag to my_fopen for binary streams */ +#endif #ifdef HAVE_FCNTL #define HAVE_FCNTL_LOCK #define F_TO_EOF 0L /* Param to lockf() to lock rest of file */ #endif #endif /* O_SHARE */ + #ifndef O_TEMPORARY #define O_TEMPORARY 0 #endif @@ -795,10 +804,9 @@ typedef char bool; /* Ordinary boolean values 0 1 */ #define MY_HOW_OFTEN_TO_ALARM 2 /* How often we want info on screen */ #define MY_HOW_OFTEN_TO_WRITE 1000 /* How often we want info on screen */ +#ifndef set_timespec #ifdef HAVE_TIMESPEC_TS_SEC #define set_timespec(ABSTIME,SEC) { (ABSTIME).ts_sec=time(0) + (time_t) (SEC); (ABSTIME).ts_nsec=0; } -#elif defined(__WIN__) -#define set_timespec(ABSTIME,SEC) { (ABSTIME).tv_sec=time((time_t*)0) + (time_t) (SEC); (ABSTIME).tv_nsec=0; } #else #define set_timespec(ABSTIME,SEC) \ {\ @@ -807,7 +815,8 @@ typedef char bool; /* Ordinary boolean values 0 1 */ (ABSTIME).tv_sec=tv.tv_sec+(time_t) (SEC);\ (ABSTIME).tv_nsec=tv.tv_usec*1000;\ } -#endif +#endif /* HAVE_TIMESPEC_TS_SEC */ +#endif /* set_timespec */ /* Define-funktions for reading and storing in machine independent format diff --git a/include/my_net.h b/include/my_net.h index ec985ded76b..28d862d8528 100644 --- a/include/my_net.h +++ b/include/my_net.h @@ -44,7 +44,7 @@ C_MODE_START #include <sys/ioctl.h> #endif -#if !defined(MSDOS) && !defined(__WIN__) && !defined(HAVE_BROKEN_NETINET_INCLUDES) && !defined(__BEOS__) +#if !defined(MSDOS) && !defined(__WIN__) && !defined(HAVE_BROKEN_NETINET_INCLUDES) && !defined(__BEOS__) && !defined(__NETWARE__) #include <netinet/in_systm.h> #include <netinet/in.h> #include <netinet/ip.h> diff --git a/include/my_pthread.h b/include/my_pthread.h index e0394bc978a..bea6b8bef5a 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -356,6 +356,14 @@ extern int my_pthread_cond_timedwait(pthread_cond_t *cond, #define pthread_cond_timedwait(A,B,C) my_pthread_cond_timedwait((A),(B),(C)) #endif + +#ifdef __NETWARE__ +extern int my_pthread_cond_timedwait(pthread_cond_t *cond, + pthread_mutex_t *mutex, + struct timespec *abstime); +#define pthread_cond_timedwait(A,B,C) my_pthread_cond_timedwait((A),(B),(C)) +#endif /* __NETWARE__ */ + #if defined(OS2) #define my_pthread_getspecific(T,A) ((T) &(A)) #define pthread_setspecific(A,B) win_pthread_setspecific(&(A),(B),sizeof(A)) @@ -443,15 +451,39 @@ int my_pthread_mutex_trylock(pthread_mutex_t *mutex); /* safe_mutex adds checking to mutex for easier debugging */ +#if defined(__NETWARE__) && !defined(SAFE_MUTEX_DETECT_DESTROY) +#define SAFE_MUTEX_DETECT_DESTROY +#endif + typedef struct st_safe_mutex_t { pthread_mutex_t global,mutex; char *file; uint line,count; pthread_t thread; +#ifdef SAFE_MUTEX_DETECT_DESTROY + struct st_safe_mutex_info_t *info; /* to track destroying of mutexes */ +#endif } safe_mutex_t; -int safe_mutex_init(safe_mutex_t *mp, const pthread_mutexattr_t *attr); +#ifdef SAFE_MUTEX_DETECT_DESTROY +/* + Used to track the destroying of mutexes. This needs to be a seperate + structure because the safe_mutex_t structure could be freed before + the mutexes are destroyed. +*/ + +typedef struct st_safe_mutex_info_t +{ + struct st_safe_mutex_info_t *next; + struct st_safe_mutex_info_t *prev; + char *init_file; + uint32 init_line; +} safe_mutex_info_t; +#endif /* SAFE_MUTEX_DETECT_DESTROY */ + +int safe_mutex_init(safe_mutex_t *mp, const pthread_mutexattr_t *attr, + const char *file, uint line); int safe_mutex_lock(safe_mutex_t *mp,const char *file, uint line); int safe_mutex_unlock(safe_mutex_t *mp,const char *file, uint line); int safe_mutex_destroy(safe_mutex_t *mp,const char *file, uint line); @@ -459,6 +491,8 @@ int safe_cond_wait(pthread_cond_t *cond, safe_mutex_t *mp,const char *file, uint line); int safe_cond_timedwait(pthread_cond_t *cond, safe_mutex_t *mp, struct timespec *abstime, const char *file, uint line); +void safe_mutex_global_init(void); +void safe_mutex_end(FILE *file); /* Wrappers if safe mutex is actually used */ #ifdef SAFE_MUTEX @@ -472,7 +506,7 @@ int safe_cond_timedwait(pthread_cond_t *cond, safe_mutex_t *mp, #undef pthread_cond_wait #undef pthread_cond_timedwait #undef pthread_mutex_trylock -#define pthread_mutex_init(A,B) safe_mutex_init((A),(B)) +#define pthread_mutex_init(A,B) safe_mutex_init((A),(B),__FILE__,__LINE__) #define pthread_mutex_lock(A) safe_mutex_lock((A),__FILE__,__LINE__) #define pthread_mutex_unlock(A) safe_mutex_unlock((A),__FILE__,__LINE__) #define pthread_mutex_destroy(A) safe_mutex_destroy((A),__FILE__,__LINE__) diff --git a/include/my_sys.h b/include/my_sys.h index 5dd09dc5ec4..4bd9f53f7e4 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -731,29 +731,32 @@ extern void my_free_lock(byte *ptr,myf flags); #define my_free_lock(A,B) my_free((A),(B)) #endif #define alloc_root_inited(A) ((A)->min_malloc != 0) -void init_alloc_root(MEM_ROOT *mem_root, uint block_size, uint pre_alloc_size); -gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size); -void free_root(MEM_ROOT *root, myf MyFLAGS); -void set_prealloc_root(MEM_ROOT *root, char *ptr); -char *strdup_root(MEM_ROOT *root,const char *str); -char *strmake_root(MEM_ROOT *root,const char *str,uint len); -char *memdup_root(MEM_ROOT *root,const char *str,uint len); -void load_defaults(const char *conf_file, const char **groups, - int *argc, char ***argv); -void free_defaults(char **argv); -void print_defaults(const char *conf_file, const char **groups); -my_bool my_compress(byte *, ulong *, ulong *); -my_bool my_uncompress(byte *, ulong *, ulong *); -byte *my_compress_alloc(const byte *packet, ulong *len, ulong *complen); -ulong checksum(const byte *mem, uint count); -uint my_bit_log2(ulong value); - -#if defined(_MSC_VER) && !defined(__WIN__) -extern void sleep(int sec); -#endif +extern void init_alloc_root(MEM_ROOT *mem_root, uint block_size, + uint pre_alloc_size); +extern gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size); +extern void free_root(MEM_ROOT *root, myf MyFLAGS); +extern void set_prealloc_root(MEM_ROOT *root, char *ptr); +extern char *strdup_root(MEM_ROOT *root,const char *str); +extern char *strmake_root(MEM_ROOT *root,const char *str,uint len); +extern char *memdup_root(MEM_ROOT *root,const char *str,uint len); +extern void load_defaults(const char *conf_file, const char **groups, + int *argc, char ***argv); +extern void free_defaults(char **argv); +extern void print_defaults(const char *conf_file, const char **groups); +extern my_bool my_compress(byte *, ulong *, ulong *); +extern my_bool my_uncompress(byte *, ulong *, ulong *); +extern byte *my_compress_alloc(const byte *packet, ulong *len, ulong *complen); +extern ulong checksum(const byte *mem, uint count); +extern uint my_bit_log2(ulong value); +extern void my_sleep(ulong m_seconds); + #ifdef __WIN__ extern my_bool have_tcpip; /* Is set if tcpip is used */ #endif +#ifdef __NETWARE__ +void netware_reg_user(const char *ip, const char *user, + const char *application); +#endif C_MODE_END #include "raid.h" diff --git a/include/mysql.h b/include/mysql.h index 8d497720a23..486caa5baa5 100644 --- a/include/mysql.h +++ b/include/mysql.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (C) 2000-2003 MySQL AB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -60,6 +60,10 @@ typedef int my_socket; extern unsigned int mysql_port; extern char *mysql_unix_port; +#ifdef __NETWARE__ +#pragma pack(push, 8) /* 8 byte alignment */ +#endif + #define IS_PRI_KEY(n) ((n) & PRI_KEY_FLAG) #define IS_NOT_NULL(n) ((n) & NOT_NULL_FLAG) #define IS_BLOB(n) ((n) & BLOB_FLAG) @@ -418,6 +422,11 @@ int STDCALL mysql_drop_db(MYSQL *mysql, const char *DB); int simple_command(MYSQL *mysql,enum enum_server_command command, const char *arg, unsigned long length, my_bool skipp_check); unsigned long net_safe_read(MYSQL* mysql); +void STDCALL mysql_once_init(void); + +#ifdef __NETWARE__ +#pragma pack(pop) /* restore alignment */ +#endif #ifdef __cplusplus } |