MCPcopy Create free account
hub / github.com/apple/foundationdb / asyncSync

Function asyncSync

fdbserver/VFSAsync.cpp:208–226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

206}
207
208static int asyncSync(sqlite3_file* pFile, int flags) {
209 VFSAsyncFile* p = (VFSAsyncFile*)pFile;
210 try {
211 waitFor(p->file->sync());
212 return SQLITE_OK;
213 } catch (Error& e) {
214 if (e.isInjectedFault()) {
215 VFSAsyncFile::setInjectedError(SQLITE_IOERR_FSYNC);
216 }
217
218 TraceEvent("VFSAsyncFileSyncError")
219 .error(e)
220 .detail("Filename", p->filename)
221 .detail("Sqlite3File", (int64_t)pFile)
222 .detail("IAsyncFile", (int64_t)p->file.getPtr());
223
224 return SQLITE_IOERR_FSYNC;
225 }
226}
227
228/*
229** Write the size of the file in bytes to *pSize.

Callers

nothing calls this directly

Calls 7

waitForFunction · 0.85
TraceEventClass · 0.85
isInjectedFaultMethod · 0.80
detailMethod · 0.80
syncMethod · 0.45
errorMethod · 0.45
getPtrMethod · 0.45

Tested by

no test coverage detected