diff options
author | Sergei Golubchik <serg@mariadb.org> | 2022-02-10 21:07:03 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2022-02-10 21:07:03 +0100 |
commit | e3894f5d397722dd50fb91dbbdbad3aaf017a4b0 (patch) | |
tree | 5d10a3e673c780b1588cda82e88a3d899345c416 /tpool | |
parent | cce994057bf7e2bdb62686075de03aeb5db4bbda (diff) | |
parent | 9aa3564e8a06c3d2027fc514213ecf42b049b06e (diff) | |
download | mariadb-git-e3894f5d397722dd50fb91dbbdbad3aaf017a4b0.tar.gz |
Merge branch '10.5 into 10.6mariadb-10.6.7
Diffstat (limited to 'tpool')
-rw-r--r-- | tpool/aio_simulated.cc | 9 | ||||
-rw-r--r-- | tpool/tpool.h | 4 |
2 files changed, 8 insertions, 5 deletions
diff --git a/tpool/aio_simulated.cc b/tpool/aio_simulated.cc index 93b2ae134b2..6b6fe71c8ab 100644 --- a/tpool/aio_simulated.cc +++ b/tpool/aio_simulated.cc @@ -72,7 +72,7 @@ struct WinIoInit static WinIoInit win_io_init; -int pread(const native_file_handle &h, void *buf, size_t count, +SSIZE_T pread(const native_file_handle &h, void *buf, size_t count, unsigned long long offset) { OVERLAPPED ov{}; @@ -81,6 +81,8 @@ int pread(const native_file_handle &h, void *buf, size_t count, ov.Offset= uli.LowPart; ov.OffsetHigh= uli.HighPart; ov.hEvent= win_get_syncio_event(); + if (count > 0xFFFFFFFF) + count= 0xFFFFFFFF; if (ReadFile(h, buf, (DWORD) count, 0, &ov) || (GetLastError() == ERROR_IO_PENDING)) @@ -93,7 +95,7 @@ int pread(const native_file_handle &h, void *buf, size_t count, return -1; } -int pwrite(const native_file_handle &h, void *buf, size_t count, +SSIZE_T pwrite(const native_file_handle &h, void *buf, size_t count, unsigned long long offset) { OVERLAPPED ov{}; @@ -102,7 +104,8 @@ int pwrite(const native_file_handle &h, void *buf, size_t count, ov.Offset= uli.LowPart; ov.OffsetHigh= uli.HighPart; ov.hEvent= win_get_syncio_event(); - + if (count > 0xFFFFFFFF) + count= 0xFFFFFFFF; if (WriteFile(h, buf, (DWORD) count, 0, &ov) || (GetLastError() == ERROR_IO_PENDING)) { diff --git a/tpool/tpool.h b/tpool/tpool.h index 8d14d637914..f857dddd57a 100644 --- a/tpool/tpool.h +++ b/tpool/tpool.h @@ -245,9 +245,9 @@ create_thread_pool_win(int min_threads= DEFAULT_MIN_POOL_THREADS, opened with FILE_FLAG_OVERLAPPED, and bound to completion port. */ -int pwrite(const native_file_handle &h, void *buf, size_t count, +SSIZE_T pwrite(const native_file_handle &h, void *buf, size_t count, unsigned long long offset); -int pread(const native_file_handle &h, void *buf, size_t count, +SSIZE_T pread(const native_file_handle &h, void *buf, size_t count, unsigned long long offset); HANDLE win_get_syncio_event(); #endif |