summaryrefslogtreecommitdiff
path: root/mysys/my_mmap.c
diff options
context:
space:
mode:
authorunknown <msvensson@shellback.(none)>2006-04-04 09:59:19 +0200
committerunknown <msvensson@shellback.(none)>2006-04-04 09:59:19 +0200
commit89c8b298f0ae707a186b988dd079488f812adae0 (patch)
tree13f040c0d73f44e2fceb698666f340d1cd52aee1 /mysys/my_mmap.c
parentf9dd31ca8ec96c2c315a9f8011d4f1ed5b73b0a4 (diff)
downloadmariadb-git-89c8b298f0ae707a186b988dd079488f812adae0.tar.gz
Bug#17368 General log and slow query log don't work
- Port ha_tina.cc to run on windows include/my_sys.h: Add define for MAP_PRIVATE, to be used in my_mmap to decide what kind of map to open. mysys/my_mmap.c: Remove unused flProtect Look at "prot" argument when deciding if map should be read or write. storage/csv/ha_tina.cc: Remove "include <sys/mman.h>", use the defines and functions from mysys Add cast to byte* when calling 'my_write' Add cast to char* when calling 'buffer.set' munmap the file before setting it's size, my_chsize will fail if file is mapped. storage/csv/ha_tina.h: Remove "typedef" since no name is defined and "tina_set" is used in the code
Diffstat (limited to 'mysys/my_mmap.c')
-rw-r--r--mysys/my_mmap.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/mysys/my_mmap.c b/mysys/my_mmap.c
index 21bfddae46c..19d9541a967 100644
--- a/mysys/my_mmap.c
+++ b/mysys/my_mmap.c
@@ -43,22 +43,19 @@ int my_getpagesize(void)
void *my_mmap(void *addr, size_t len, int prot,
int flags, int fd, my_off_t offset)
{
- DWORD flProtect=0;
HANDLE hFileMap;
LPVOID ptr;
HANDLE hFile= (HANDLE)_get_osfhandle(fd);
if (hFile == INVALID_HANDLE_VALUE)
return MAP_FAILED;
- flProtect|=SEC_COMMIT;
-
hFileMap=CreateFileMapping(hFile, &mmap_security_attributes,
PAGE_READWRITE, 0, (DWORD) len, NULL);
if (hFileMap == 0)
return MAP_FAILED;
ptr=MapViewOfFile(hFileMap,
- flags & PROT_WRITE ? FILE_MAP_WRITE : FILE_MAP_READ,
+ prot & PROT_WRITE ? FILE_MAP_WRITE : FILE_MAP_READ,
(DWORD)(offset >> 32), (DWORD)offset, len);
/*