Condy v1.9
C++ Asynchronous System Call Layer for Linux
Loading...
Searching...
No Matches
ublk-loop.cpp File Reference

ublk loop block device server using condy More...

#include <condy.hpp>
#include <csignal>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fcntl.h>
#include <format>
#include <iostream>
#include <linux/ublk_cmd.h>
#include <sys/mman.h>
#include <sys/signalfd.h>
#include <unistd.h>
#include <vector>

Go to the source code of this file.

Detailed Description

ublk loop block device server using condy

This example demonstrates how condy's coroutine model simplifies writing a ublk server: the fetch -> perform I/O -> commit request/response loop becomes straight-line code, with one io_loop() coroutine per tag awaiting async_uring_cmd for fetch/commit and async_read/async_write/ async_fsync for the backing file.

Definition in file ublk-loop.cpp.