diff options
author | msvensson@neptunus.(none) <> | 2006-12-04 19:11:55 +0100 |
---|---|---|
committer | msvensson@neptunus.(none) <> | 2006-12-04 19:11:55 +0100 |
commit | 971c783f7dd3a136693722f20a815b7171bbbcd8 (patch) | |
tree | ac382a3e694ccbe7ed5a481331e35e4f055fdcae /mysys | |
parent | 6072b7a4c4b786604b4584058c6c62a339b6d3ba (diff) | |
parent | b70d2b9341ae804fbd5147500a4d29bd86e2a5d6 (diff) | |
download | mariadb-git-971c783f7dd3a136693722f20a815b7171bbbcd8.tar.gz |
Merge neptunus.(none):/home/msvensson/mysql/mysql-5.1
into neptunus.(none):/home/msvensson/mysql/mysql-5.1-maint
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/CMakeLists.txt | 2 | ||||
-rw-r--r-- | mysys/Makefile.am | 2 | ||||
-rw-r--r-- | mysys/my_getopt.c | 6 | ||||
-rw-r--r-- | mysys/my_getpagesize.c | 41 | ||||
-rw-r--r-- | mysys/my_mmap.c | 7 |
5 files changed, 48 insertions, 10 deletions
diff --git a/mysys/CMakeLists.txt b/mysys/CMakeLists.txt index 7b362b4c1f9..ddbb5f5c328 100644 --- a/mysys/CMakeLists.txt +++ b/mysys/CMakeLists.txt @@ -26,4 +26,4 @@ ADD_LIBRARY(mysys array.c charset-def.c charset.c checksum.c default.c default_m my_static.c my_symlink.c my_symlink2.c my_sync.c my_thr_init.c my_wincond.c my_windac.c my_winsem.c my_winthread.c my_write.c ptr_cmp.c queues.c rijndael.c safemalloc.c sha1.c string.c thr_alarm.c thr_lock.c thr_mutex.c - thr_rwlock.c tree.c typelib.c my_vle.c base64.c my_memmem.c) + thr_rwlock.c tree.c typelib.c my_vle.c base64.c my_memmem.c my_getpagesize.c) diff --git a/mysys/Makefile.am b/mysys/Makefile.am index e115739b421..fb3f0e1688e 100644 --- a/mysys/Makefile.am +++ b/mysys/Makefile.am @@ -25,7 +25,7 @@ noinst_HEADERS = mysys_priv.h my_static.h libmysys_a_SOURCES = my_init.c my_getwd.c mf_getdate.c my_mmap.c \ mf_path.c mf_loadpath.c my_file.c \ my_open.c my_create.c my_dup.c my_seek.c my_read.c \ - my_pread.c my_write.c \ + my_pread.c my_write.c my_getpagesize.c \ mf_keycache.c mf_keycaches.c my_crc32.c \ mf_iocache.c mf_iocache2.c mf_cache.c mf_tempfile.c \ mf_tempdir.c my_lock.c mf_brkhant.c my_alarm.c \ diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c index 13524ce4e13..c26c3dd46e0 100644 --- a/mysys/my_getopt.c +++ b/mysys/my_getopt.c @@ -59,11 +59,15 @@ char *disabled_my_option= (char*) "0"; my_bool my_getopt_print_errors= 1; -static void default_reporter(enum loglevel level __attribute__((unused)), +static void default_reporter(enum loglevel level, const char *format, ...) { va_list args; va_start(args, format); + if (level == WARNING_LEVEL) + fprintf(stderr, "%s", "Warning: "); + else if (level == INFORMATION_LEVEL) + fprintf(stderr, "%s", "Info: "); vfprintf(stderr, format, args); va_end(args); } diff --git a/mysys/my_getpagesize.c b/mysys/my_getpagesize.c new file mode 100644 index 00000000000..ac4bd775ba9 --- /dev/null +++ b/mysys/my_getpagesize.c @@ -0,0 +1,41 @@ +/* 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 + 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 */ + +#include "mysys_priv.h" + +#ifndef HAVE_GETPAGESIZE + +#if defined __WIN__ + +int my_getpagesize(void) +{ + SYSTEM_INFO si; + GetSystemInfo(&si); + return si.dwPageSize; +} + +#else + +/* Default implementation */ +int my_getpagesize(void) +{ + return (int)8192; +} + +#endif + +#endif + diff --git a/mysys/my_mmap.c b/mysys/my_mmap.c index 19d9541a967..79030c0a695 100644 --- a/mysys/my_mmap.c +++ b/mysys/my_mmap.c @@ -33,13 +33,6 @@ int my_msync(int fd, void *addr, size_t len, int flags) static SECURITY_ATTRIBUTES mmap_security_attributes= {sizeof(SECURITY_ATTRIBUTES), 0, TRUE}; -int my_getpagesize(void) -{ - SYSTEM_INFO si; - GetSystemInfo(&si); - return si.dwPageSize; -} - void *my_mmap(void *addr, size_t len, int prot, int flags, int fd, my_off_t offset) { |