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

Method synchronous

tpool/aio_simulated.cc:180–209  ·  view source on GitHub ↗

Process the cb synchronously */

Source from the content-addressed store, hash-verified

178 Process the cb synchronously
179*/
180void aio::synchronous(aiocb *cb)
181{
182 intptr_t ret_len;
183 int err= 0;
184 switch (cb->m_opcode)
185 {
186 case aio_opcode::AIO_PREAD:
187 ret_len= pread(cb->m_fh, cb->m_buffer, cb->m_len, cb->m_offset);
188 break;
189 case aio_opcode::AIO_PWRITE:
190 ret_len= pwrite(cb->m_fh, cb->m_buffer, cb->m_len, cb->m_offset);
191 break;
192 default:
193 abort();
194 }
195
196 if (ret_len < 0)
197 {
198#ifdef _WIN32
199 err= GetLastError();
200#else
201 err= errno;
202#endif
203 ret_len= 0;
204 }
205 cb->m_ret_len = ret_len;
206 cb->m_err = err;
207 if (ret_len)
208 finish_synchronous(cb);
209}
210
211} // namespace tpool

Callers

nothing calls this directly

Calls 3

preadFunction · 0.85
pwriteFunction · 0.85
GetLastErrorFunction · 0.85

Tested by

no test coverage detected