summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorunknown <monty@mashka.mysql.fi>2004-02-19 19:33:09 +0200
committerunknown <monty@mashka.mysql.fi>2004-02-19 19:33:09 +0200
commitddbb78809dcce02d649eae436c77799d7a76983e (patch)
tree86d1d367349c537e9cbd45f6bf0ba3c2315f1a59 /include
parent62cc89aad50b00c0ab1ef3e94c5a3467eb78eb70 (diff)
downloadmariadb-git-ddbb78809dcce02d649eae436c77799d7a76983e.tar.gz
Max open files handling moved to my_set_max_open_files()
This ensures that my_file_info takes this the max number of files into account and one can now use --open-files-limit on windows to increase number of used files up to 2048 client/client_priv.h: Added --open-files-limit to mysqlbinlog client/mysqlbinlog.cc: Added --open-files-limit to mysqlbinlog include/config-win.h: Define that you can have up to 2048 files open on windows include/my_global.h: Allow override of OS_FILE_LIMIT include/my_sys.h: Cleanup Added prototypes for my_set_max_open_files() and my_free_open_files() libmysql/Makefile.shared: Added my_file.c myisam/myisamlog.c: Use my_set_max_open_files() mysys/Makefile.am: Use my_file.c (for mysqlbinlog) mysys/my_alloc.c: Remove compiler warning mysys/my_div.c: MY_NFILE -> my_file_limit mysys/my_dup.c: MY_NFILE -> my_file_limit mysys/my_fopen.c: MY_NFILE -> my_file_limit mysys/my_open.c: MY_NFILE -> my_file_limit mysys/my_static.c: Allow changing of open files limit mysys/my_static.h: Allow changing of open files limit sql/mysqld.cc: Max open files handling moved to my_set_max_open_files()
Diffstat (limited to 'include')
-rw-r--r--include/config-win.h2
-rw-r--r--include/my_global.h5
-rw-r--r--include/my_sys.h38
3 files changed, 27 insertions, 18 deletions
diff --git a/include/config-win.h b/include/config-win.h
index 10490fd2f91..abc1aa7a6ee 100644
--- a/include/config-win.h
+++ b/include/config-win.h
@@ -323,7 +323,7 @@ inline double ulonglong2double(ulonglong value)
#define FN_ROOTDIR "\\"
#define FN_NETWORK_DRIVES /* Uses \\ to indicate network drives */
#define FN_NO_CASE_SENCE /* Files are not case-sensitive */
-#define MY_NFILE 1024
+#define OS_FILE_LIMIT 2048
#define DO_NOT_REMOVE_THREAD_WRAPPERS
#define thread_safe_increment(V,L) InterlockedIncrement((long*) &(V))
diff --git a/include/my_global.h b/include/my_global.h
index 4a1786f70e2..184b5aedcfc 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -535,7 +535,10 @@ typedef SOCKET_SIZE_TYPE size_socket;
#define FN_LIBCHAR '/'
#define FN_ROOTDIR "/"
#endif
-#define MY_NFILE 1024 /* This is only used to save filenames */
+#endif
+#define MY_NFILE 64 /* This is only used to save filenames */
+#ifndef OS_FILE_LIMIT
+#define OS_FILE_LIMIT 65535
#endif
/* #define EXT_IN_LIBNAME */
diff --git a/include/my_sys.h b/include/my_sys.h
index d3e69a61962..9254f29ee72 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -202,26 +202,13 @@ extern char NEAR curr_dir[]; /* Current directory for user */
extern int (*error_handler_hook)(uint my_err, const char *str,myf MyFlags);
extern int (*fatal_error_handler_hook)(uint my_err, const char *str,
myf MyFlags);
+extern uint my_file_limit;
/* charsets */
extern CHARSET_INFO *default_charset_info;
extern CHARSET_INFO *all_charsets[256];
extern CHARSET_INFO compiled_charsets[];
-extern uint get_charset_number(const char *cs_name, uint cs_flags);
-extern uint get_collation_number(const char *name);
-extern const char *get_charset_name(uint cs_number);
-
-extern CHARSET_INFO *get_charset(uint cs_number, myf flags);
-extern CHARSET_INFO *get_charset_by_name(const char *cs_name, myf flags);
-extern CHARSET_INFO *get_charset_by_csname(const char *cs_name,
- uint cs_flags, myf my_flags);
-extern void free_charsets(void);
-extern char *get_charsets_dir(char *buf);
-extern my_bool my_charset_same(CHARSET_INFO *cs1, CHARSET_INFO *cs2);
-extern my_bool init_compiled_charsets(myf flags);
-extern void add_compiled_collation(CHARSET_INFO *cs);
-
/* statistics */
extern ulong my_cache_w_requests, my_cache_write, my_cache_r_requests,
my_cache_read;
@@ -288,14 +275,16 @@ enum file_type
FILE_BY_MKSTEMP, FILE_BY_DUP
};
-extern struct my_file_info
+struct st_my_file_info
{
my_string name;
enum file_type type;
#if defined(THREAD) && !defined(HAVE_PREAD)
pthread_mutex_t mutex;
#endif
-} my_file_info[MY_NFILE];
+};
+
+extern struct st_my_file_info *my_file_info;
typedef struct st_my_tmpdir
{
@@ -747,6 +736,23 @@ extern uint my_bit_log2(ulong value);
extern uint my_count_bits(ulonglong v);
extern void my_sleep(ulong m_seconds);
extern ulong crc32(ulong crc, const uchar *buf, uint len);
+extern uint my_set_max_open_files(uint files);
+void my_free_open_file_info(void);
+
+/* character sets */
+extern uint get_charset_number(const char *cs_name, uint cs_flags);
+extern uint get_collation_number(const char *name);
+extern const char *get_charset_name(uint cs_number);
+
+extern CHARSET_INFO *get_charset(uint cs_number, myf flags);
+extern CHARSET_INFO *get_charset_by_name(const char *cs_name, myf flags);
+extern CHARSET_INFO *get_charset_by_csname(const char *cs_name,
+ uint cs_flags, myf my_flags);
+extern void free_charsets(void);
+extern char *get_charsets_dir(char *buf);
+extern my_bool my_charset_same(CHARSET_INFO *cs1, CHARSET_INFO *cs2);
+extern my_bool init_compiled_charsets(myf flags);
+extern void add_compiled_collation(CHARSET_INFO *cs);
#ifdef __WIN__
extern my_bool have_tcpip; /* Is set if tcpip is used */