diff options
author | Vladislav Vaintroub <wlad@montyprogram.com> | 2011-06-12 15:52:07 +0200 |
---|---|---|
committer | Vladislav Vaintroub <wlad@montyprogram.com> | 2011-06-12 15:52:07 +0200 |
commit | 4171483b539555f50336d4304d931ef743cf7011 (patch) | |
tree | fe7d215b1d77b11bf630479aab5bbb71e63b050c /mysys/my_read.c | |
parent | 824ce5f3eae52ee418665211c24218a5772c43f2 (diff) | |
download | mariadb-git-4171483b539555f50336d4304d931ef743cf7011.tar.gz |
Backport Fix for Bug#24509 - 2048 file descriptor limit on windows needs increasing.
The patch replaces the use of the POSIX I/O interfaces in mysys on Windows with
the Win32 API calls (CreateFile, WriteFile, etc). The Windows HANDLE for the open
file is stored in the my_file_info struct, along with a flag for append mode
(because the Windows API does not support opening files in append mode in all cases)
The default max open files has been increased to 16384 and can be increased further
by setting --max-open-files=<value> during the server start.
Noteworthy benefit of this patch is that it removes limits from the table_cache size -
allowing for more simultaneus users
Diffstat (limited to 'mysys/my_read.c')
-rw-r--r-- | mysys/my_read.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/mysys/my_read.c b/mysys/my_read.c index 25ffe73d813..9c76193aa63 100644 --- a/mysys/my_read.c +++ b/mysys/my_read.c @@ -44,7 +44,12 @@ size_t my_read(File Filedes, uchar *Buffer, size_t Count, myf MyFlags) for (;;) { errno= 0; /* Linux, Windows don't reset this on EOF/success */ - if ((readbytes= read(Filedes, Buffer, (uint) Count)) != Count) +#ifdef _WIN32 + readbytes= my_win_read(Filedes, Buffer, Count); +#else + readbytes= my_read(Fildes, Buffer, Count); +#endif + if (readbytes != Count) { my_errno= errno; if (errno == 0 || (readbytes != (size_t) -1 && |