Commit 52bba384 authored by unknown's avatar unknown

Changes to allow 5.0.3 to compile on Windows after XA was pushed

logging_ok:
  Logging to logging@openlogging.org accepted
mi_packrec.c:
  Using HAVE_SYS_MMAN_H to protect include of sys/mman.h and replaced calls to mmap and munmap with my_mmap and my_munmap
mi_extra.c:
  Now using HAVE_SYS_MMAN_H to protect include of sys/mman.h
my_mmap.c:
  Changed how no mmap message is printed for Windows
sql_map.cc:
  Changed HAVE_MMAP to HAVE_SYS_MMAN_H and replaced calls to mmap and munmap with my_mmap and my_munmap


sql/sql_map.cc:
  Changed HAVE_MMAP to HAVE_SYS_MMAN_H and replaced calls to mmap and munmap with my_mmap and my_munmap
mysys/my_mmap.c:
  Changed how no mmap message is printed for Windows
myisam/mi_extra.c:
  Now using HAVE_SYS_MMAN_H to protect include of sys/mman.h
myisam/mi_packrec.c:
  Using HAVE_SYS_MMAN_H to protect include of sys/mman.h and replaced calls to mmap and munmap with my_mmap and my_munmap
BitKeeper/etc/logging_ok:
  Logging to logging@openlogging.org accepted
parent 47ed1db7
...@@ -207,6 +207,7 @@ ramil@mysql.com ...@@ -207,6 +207,7 @@ ramil@mysql.com
ranger@regul.home.lan ranger@regul.home.lan
rburnett@build.mysql.com rburnett@build.mysql.com
reggie@bob.(none) reggie@bob.(none)
reggie@mdk10.(none)
root@home.(none) root@home.(none)
root@mc04.(none) root@mc04.(none)
root@x3.internalnet root@x3.internalnet
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "myisamdef.h" #include "myisamdef.h"
#ifdef HAVE_MMAP #ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h> #include <sys/mman.h>
#endif #endif
......
...@@ -1181,11 +1181,12 @@ static uint max_bit(register uint value) ...@@ -1181,11 +1181,12 @@ static uint max_bit(register uint value)
/***************************************************************************** /*****************************************************************************
Some redefined functions to handle files when we are using memmap Some redefined functions to handle files when we are using memmap
*****************************************************************************/ *****************************************************************************/
#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
#endif
#ifdef HAVE_MMAP #ifdef HAVE_MMAP
#include <sys/mman.h>
static int _mi_read_mempack_record(MI_INFO *info,my_off_t filepos,byte *buf); static int _mi_read_mempack_record(MI_INFO *info,my_off_t filepos,byte *buf);
static int _mi_read_rnd_mempack_record(MI_INFO*, byte *,my_off_t, my_bool); static int _mi_read_rnd_mempack_record(MI_INFO*, byte *,my_off_t, my_bool);
...@@ -1211,7 +1212,7 @@ my_bool _mi_memmap_file(MI_INFO *info) ...@@ -1211,7 +1212,7 @@ my_bool _mi_memmap_file(MI_INFO *info)
DBUG_RETURN(0); DBUG_RETURN(0);
} }
file_map=(byte*) file_map=(byte*)
mmap(0,share->state.state.data_file_length+MEMMAP_EXTRA_MARGIN,PROT_READ, my_mmap(0,share->state.state.data_file_length+MEMMAP_EXTRA_MARGIN,PROT_READ,
MAP_SHARED | MAP_NORESERVE,info->dfile,0L); MAP_SHARED | MAP_NORESERVE,info->dfile,0L);
if (file_map == (byte*) MAP_FAILED) if (file_map == (byte*) MAP_FAILED)
{ {
...@@ -1230,7 +1231,7 @@ my_bool _mi_memmap_file(MI_INFO *info) ...@@ -1230,7 +1231,7 @@ my_bool _mi_memmap_file(MI_INFO *info)
void _mi_unmap_file(MI_INFO *info) void _mi_unmap_file(MI_INFO *info)
{ {
VOID(munmap((caddr_t) info->s->file_map, VOID(my_munmap((caddr_t) info->s->file_map,
(size_t) info->s->state.state.data_file_length+ (size_t) info->s->state.state.data_file_length+
MEMMAP_EXTRA_MARGIN)); MEMMAP_EXTRA_MARGIN));
} }
......
...@@ -84,6 +84,12 @@ int my_msync(int fd, void *addr, size_t len, int flags) ...@@ -84,6 +84,12 @@ int my_msync(int fd, void *addr, size_t len, int flags)
} }
#endif #endif
#ifdef _WINDOWS
#pragma message "no mmap!"
#else
#warning "no mmap!" #warning "no mmap!"
#endif #endif
#endif
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#endif #endif
#include "mysql_priv.h" #include "mysql_priv.h"
#ifdef HAVE_MMAP #ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h> #include <sys/mman.h>
#include <sys/stat.h> #include <sys/stat.h>
#endif #endif
...@@ -42,7 +42,7 @@ mapped_files::mapped_files(const my_string filename,byte *magic,uint magic_lengt ...@@ -42,7 +42,7 @@ mapped_files::mapped_files(const my_string filename,byte *magic,uint magic_lengt
struct stat stat_buf; struct stat stat_buf;
if (!fstat(file,&stat_buf)) if (!fstat(file,&stat_buf))
{ {
if (!(map=(byte*) mmap(0,(size=(ulong) stat_buf.st_size),PROT_READ, if (!(map=(byte*) my_mmap(0,(size=(ulong) stat_buf.st_size),PROT_READ,
MAP_SHARED | MAP_NORESERVE,file, MAP_SHARED | MAP_NORESERVE,file,
0L))) 0L)))
{ {
...@@ -53,7 +53,7 @@ mapped_files::mapped_files(const my_string filename,byte *magic,uint magic_lengt ...@@ -53,7 +53,7 @@ mapped_files::mapped_files(const my_string filename,byte *magic,uint magic_lengt
if (map && memcmp(map,magic,magic_length)) if (map && memcmp(map,magic,magic_length))
{ {
my_error(ER_WRONG_MAGIC, MYF(0), name); my_error(ER_WRONG_MAGIC, MYF(0), name);
VOID(munmap(map,size)); VOID(my_munmap(map,size));
map=0; map=0;
} }
if (!map) if (!map)
...@@ -71,7 +71,7 @@ mapped_files::~mapped_files() ...@@ -71,7 +71,7 @@ mapped_files::~mapped_files()
#ifdef HAVE_MMAP #ifdef HAVE_MMAP
if (file >= 0) if (file >= 0)
{ {
VOID(munmap((caddr_t) map,size)); VOID(my_munmap((caddr_t) map,size));
VOID(my_close(file,MYF(0))); VOID(my_close(file,MYF(0)));
file= -1; map=0; file= -1; map=0;
} }
......
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