MCPcopy Create free account
hub / github.com/MariaDB/server / pread

Function pread

tpool/aio_simulated.cc:75–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73
74
75SSIZE_T pread(const native_file_handle &h, void *buf, size_t count,
76 unsigned long long offset)
77{
78 OVERLAPPED ov{};
79 ULARGE_INTEGER uli;
80 uli.QuadPart= offset;
81 ov.Offset= uli.LowPart;
82 ov.OffsetHigh= uli.HighPart;
83 ov.hEvent= win_get_syncio_event();
84 if (count > 0xFFFFFFFF)
85 count= 0xFFFFFFFF;
86
87 if (ReadFile(h, buf, (DWORD) count, 0, &ov) ||
88 (GetLastError() == ERROR_IO_PENDING))
89 {
90 DWORD n_bytes;
91 if (GetOverlappedResult(h, &ov, &n_bytes, TRUE))
92 return n_bytes;
93 }
94
95 return -1;
96}
97
98SSIZE_T pwrite(const native_file_handle &h, const void *buf, size_t count,
99 unsigned long long offset)

Callers 5

test_22Method · 0.85
my_preadFunction · 0.85
execute_lowMethod · 0.85
readMethod · 0.85
synchronousMethod · 0.85

Calls 2

win_get_syncio_eventFunction · 0.85
GetLastErrorFunction · 0.85

Tested by 1

test_22Method · 0.68