Add nop()

This commit is contained in:
Ian Gulliver
2019-05-18 23:22:38 -07:00
parent 3556a7bed5
commit 6039e4d2e9
3 changed files with 9 additions and 0 deletions

View File

@@ -39,6 +39,13 @@ bool URing::Try() {
return false;
}
void URing::nop(const std::function<void(int32_t res)> &callback) {
auto *entry = GetEntry(callback);
auto *sqe = GetSQE();
io_uring_prep_nop(sqe);
io_uring_sqe_set_data(sqe, reinterpret_cast<void *>(entry));
}
void URing::write(int fd, const void *buf, size_t count,
const std::function<void(int32_t res)> &callback) {
std::vector<iovec> vecs{