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

Function pwrite

tpool/aio_simulated.cc:98–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96}
97
98SSIZE_T pwrite(const native_file_handle &h, const void *buf, size_t count,
99 unsigned long long offset)
100{
101 OVERLAPPED ov{};
102 ULARGE_INTEGER uli;
103 uli.QuadPart= offset;
104 ov.Offset= uli.LowPart;
105 ov.OffsetHigh= uli.HighPart;
106 ov.hEvent= win_get_syncio_event();
107 if (count > 0xFFFFFFFF)
108 count= 0xFFFFFFFF;
109 if (WriteFile(h, buf, (DWORD) count, 0, &ov) ||
110 (GetLastError() == ERROR_IO_PENDING))
111 {
112 DWORD n_bytes;
113 if (GetOverlappedResult(h, &ov, &n_bytes, TRUE))
114 return n_bytes;
115 }
116 return -1;
117}
118#endif
119
120/**

Callers 4

my_pwriteFunction · 0.85
execute_lowMethod · 0.85
writeMethod · 0.85
synchronousMethod · 0.85

Calls 2

win_get_syncio_eventFunction · 0.85
GetLastErrorFunction · 0.85

Tested by

no test coverage detected