Commit ce81e55a authored by marko's avatar marko

branches/zip: Exclude some operating system interface code

from UNIV_HOTBACKUP builds.
parent 2b4337e8
...@@ -195,6 +195,7 @@ ulint ...@@ -195,6 +195,7 @@ ulint
os_get_os_version(void); os_get_os_version(void);
/*===================*/ /*===================*/
/* out: OS_WIN95, OS_WIN31, OS_WINNT, or OS_WIN2000 */ /* out: OS_WIN95, OS_WIN31, OS_WINNT, or OS_WIN2000 */
#ifndef UNIV_HOTBACKUP
/******************************************************************** /********************************************************************
Creates the seek mutexes used in positioned reads and writes. */ Creates the seek mutexes used in positioned reads and writes. */
UNIV_INTERN UNIV_INTERN
...@@ -211,6 +212,7 @@ FILE* ...@@ -211,6 +212,7 @@ FILE*
os_file_create_tmpfile(void); os_file_create_tmpfile(void);
/*========================*/ /*========================*/
/* out: temporary file handle, or NULL on error */ /* out: temporary file handle, or NULL on error */
#endif /* !UNIV_HOTBACKUP */
/*************************************************************************** /***************************************************************************
The os_file_opendir() function opens a directory stream corresponding to the The os_file_opendir() function opens a directory stream corresponding to the
directory named by the dirname argument. The directory stream is positioned directory named by the dirname argument. The directory stream is positioned
......
...@@ -23,20 +23,22 @@ Created 10/21/1995 Heikki Tuuri ...@@ -23,20 +23,22 @@ Created 10/21/1995 Heikki Tuuri
*******************************************************/ *******************************************************/
#include "os0file.h" #include "os0file.h"
#include "os0sync.h"
#include "os0thread.h"
#include "ut0mem.h" #include "ut0mem.h"
#include "srv0srv.h" #include "srv0srv.h"
#include "srv0start.h" #include "srv0start.h"
#include "fil0fil.h" #include "fil0fil.h"
#include "buf0buf.h" #include "buf0buf.h"
#ifndef UNIV_HOTBACKUP
#if defined(UNIV_HOTBACKUP) && defined(__WIN__) # include "os0sync.h"
# include "os0thread.h"
#else /* !UNIV_HOTBACKUP */
# ifdef __WIN__
/* Add includes for the _stat() call to compile on Windows */ /* Add includes for the _stat() call to compile on Windows */
#include <sys/types.h> # include <sys/types.h>
#include <sys/stat.h> # include <sys/stat.h>
#include <errno.h> # include <errno.h>
#endif /* UNIV_HOTBACKUP */ # endif /* __WIN__ */
#endif /* !UNIV_HOTBACKUP */
/* This specifies the file permissions InnoDB uses when it creates files in /* This specifies the file permissions InnoDB uses when it creates files in
Unix; the value of os_innodb_umask is initialized in ha_innodb.cc to Unix; the value of os_innodb_umask is initialized in ha_innodb.cc to
...@@ -57,6 +59,7 @@ UNIV_INTERN ibool os_do_not_call_flush_at_each_write = FALSE; ...@@ -57,6 +59,7 @@ UNIV_INTERN ibool os_do_not_call_flush_at_each_write = FALSE;
/* We do not call os_file_flush in every os_file_write. */ /* We do not call os_file_flush in every os_file_write. */
#endif /* UNIV_DO_FLUSH */ #endif /* UNIV_DO_FLUSH */
#ifndef UNIV_HOTBACKUP
/* We use these mutexes to protect lseek + file i/o operation, if the /* We use these mutexes to protect lseek + file i/o operation, if the
OS does not provide an atomic pread or pwrite, or similar */ OS does not provide an atomic pread or pwrite, or similar */
#define OS_FILE_N_SEEK_MUTEXES 16 #define OS_FILE_N_SEEK_MUTEXES 16
...@@ -154,6 +157,7 @@ static ulint os_aio_n_segments = ULINT_UNDEFINED; ...@@ -154,6 +157,7 @@ static ulint os_aio_n_segments = ULINT_UNDEFINED;
/* If the following is TRUE, read i/o handler threads try to /* If the following is TRUE, read i/o handler threads try to
wait until a batch of new read requests have been posted */ wait until a batch of new read requests have been posted */
static ibool os_aio_recommend_sleep_for_read_threads = FALSE; static ibool os_aio_recommend_sleep_for_read_threads = FALSE;
#endif /* !UNIV_HOTBACKUP */
UNIV_INTERN ulint os_n_file_reads = 0; UNIV_INTERN ulint os_n_file_reads = 0;
UNIV_INTERN ulint os_bytes_read_since_printout = 0; UNIV_INTERN ulint os_bytes_read_since_printout = 0;
...@@ -166,8 +170,10 @@ UNIV_INTERN time_t os_last_printout; ...@@ -166,8 +170,10 @@ UNIV_INTERN time_t os_last_printout;
UNIV_INTERN ibool os_has_said_disk_full = FALSE; UNIV_INTERN ibool os_has_said_disk_full = FALSE;
#ifndef UNIV_HOTBACKUP
/* The mutex protecting the following counts of pending I/O operations */ /* The mutex protecting the following counts of pending I/O operations */
static os_mutex_t os_file_count_mutex; static os_mutex_t os_file_count_mutex;
#endif /* !UNIV_HOTBACKUP */
UNIV_INTERN ulint os_file_n_pending_preads = 0; UNIV_INTERN ulint os_file_n_pending_preads = 0;
UNIV_INTERN ulint os_file_n_pending_pwrites = 0; UNIV_INTERN ulint os_file_n_pending_pwrites = 0;
UNIV_INTERN ulint os_n_pending_writes = 0; UNIV_INTERN ulint os_n_pending_writes = 0;
...@@ -497,6 +503,7 @@ os_file_lock( ...@@ -497,6 +503,7 @@ os_file_lock(
} }
#endif /* USE_FILE_LOCK */ #endif /* USE_FILE_LOCK */
#ifndef UNIV_HOTBACKUP
/******************************************************************** /********************************************************************
Creates the seek mutexes used in positioned reads and writes. */ Creates the seek mutexes used in positioned reads and writes. */
UNIV_INTERN UNIV_INTERN
...@@ -524,37 +531,32 @@ os_file_create_tmpfile(void) ...@@ -524,37 +531,32 @@ os_file_create_tmpfile(void)
/*========================*/ /*========================*/
/* out: temporary file handle, or NULL on error */ /* out: temporary file handle, or NULL on error */
{ {
#ifdef UNIV_HOTBACKUP #ifdef __NETWARE__
ut_error;
return(NULL);
#else
# ifdef __NETWARE__
FILE* file = tmpfile(); FILE* file = tmpfile();
# else /* __NETWARE__ */ #else /* __NETWARE__ */
FILE* file = NULL; FILE* file = NULL;
int fd = innobase_mysql_tmpfile(); int fd = innobase_mysql_tmpfile();
if (fd >= 0) { if (fd >= 0) {
file = fdopen(fd, "w+b"); file = fdopen(fd, "w+b");
} }
# endif /* __NETWARE__ */ #endif /* __NETWARE__ */
if (!file) { if (!file) {
ut_print_timestamp(stderr); ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
" InnoDB: Error: unable to create temporary file;" " InnoDB: Error: unable to create temporary file;"
" errno: %d\n", errno); " errno: %d\n", errno);
# ifndef __NETWARE__ #ifndef __NETWARE__
if (fd >= 0) { if (fd >= 0) {
close(fd); close(fd);
} }
# endif /* !__NETWARE__ */ #endif /* !__NETWARE__ */
} }
return(file); return(file);
#endif /* UNIV_HOTBACKUP */
} }
#endif /* !UNIV_HOTBACKUP */
/*************************************************************************** /***************************************************************************
The os_file_opendir() function opens a directory stream corresponding to the The os_file_opendir() function opens a directory stream corresponding to the
...@@ -2852,6 +2854,7 @@ os_file_create_subdirs_if_needed( ...@@ -2852,6 +2854,7 @@ os_file_create_subdirs_if_needed(
return(success); return(success);
} }
#ifndef UNIV_HOTBACKUP
/******************************************************************** /********************************************************************
Returns a pointer to the nth slot in the aio array. */ Returns a pointer to the nth slot in the aio array. */
static static
...@@ -4224,3 +4227,5 @@ os_aio_all_slots_free(void) ...@@ -4224,3 +4227,5 @@ os_aio_all_slots_free(void)
return(FALSE); return(FALSE);
} }
#endif /* UNIV_DEBUG */ #endif /* UNIV_DEBUG */
#endif /* !UNIV_HOTBACKUP */
...@@ -31,6 +31,7 @@ Created 9/8/1995 Heikki Tuuri ...@@ -31,6 +31,7 @@ Created 9/8/1995 Heikki Tuuri
#include <windows.h> #include <windows.h>
#endif #endif
#ifndef UNIV_HOTBACKUP
#include "srv0srv.h" #include "srv0srv.h"
#include "os0sync.h" #include "os0sync.h"
...@@ -148,7 +149,7 @@ os_thread_create( ...@@ -148,7 +149,7 @@ os_thread_create(
os_thread_t pthread; os_thread_t pthread;
pthread_attr_t attr; pthread_attr_t attr;
#if !(defined(UNIV_HOTBACKUP) && defined(UNIV_HPUX10)) #ifndef UNIV_HPUX10
pthread_attr_init(&attr); pthread_attr_init(&attr);
#endif #endif
...@@ -182,7 +183,7 @@ os_thread_create( ...@@ -182,7 +183,7 @@ os_thread_create(
os_thread_count++; os_thread_count++;
os_mutex_exit(os_sync_mutex); os_mutex_exit(os_sync_mutex);
#if defined(UNIV_HOTBACKUP) && defined(UNIV_HPUX10) #ifdef UNIV_HPUX10
ret = pthread_create(&pthread, pthread_attr_default, start_f, arg); ret = pthread_create(&pthread, pthread_attr_default, start_f, arg);
#else #else
ret = pthread_create(&pthread, &attr, start_f, arg); ret = pthread_create(&pthread, &attr, start_f, arg);
...@@ -193,7 +194,7 @@ os_thread_create( ...@@ -193,7 +194,7 @@ os_thread_create(
exit(1); exit(1);
} }
#if !(defined(UNIV_HOTBACKUP) && defined(UNIV_HPUX10)) #ifndef UNIV_HPUX10
pthread_attr_destroy(&attr); pthread_attr_destroy(&attr);
#endif #endif
if (srv_set_thread_priorities) { if (srv_set_thread_priorities) {
...@@ -266,6 +267,7 @@ os_thread_yield(void) ...@@ -266,6 +267,7 @@ os_thread_yield(void)
os_thread_sleep(0); os_thread_sleep(0);
#endif #endif
} }
#endif /* !UNIV_HOTBACKUP */
/********************************************************************* /*********************************************************************
The thread sleeps at least the time given in microseconds. */ The thread sleeps at least the time given in microseconds. */
...@@ -289,6 +291,7 @@ os_thread_sleep( ...@@ -289,6 +291,7 @@ os_thread_sleep(
#endif #endif
} }
#ifndef UNIV_HOTBACKUP
/********************************************************************** /**********************************************************************
Sets a thread priority. */ Sets a thread priority. */
UNIV_INTERN UNIV_INTERN
...@@ -363,3 +366,4 @@ os_thread_get_last_error(void) ...@@ -363,3 +366,4 @@ os_thread_get_last_error(void)
return(0); return(0);
#endif #endif
} }
#endif /* !UNIV_HOTBACKUP */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment