15#if !IO_URING_CHECK_VERSION(2, 4)
19#define CONDY_FILE_INDEX_ALLOC IORING_FILE_INDEX_ALLOC
24#define CONDY_FILE_INDEX_ALLOC (IORING_FILE_INDEX_ALLOC - 1)
38template <
typename CoroFunc>
auto will_spawn(CoroFunc &&coro) {
39 return detail::SpawnHelper<std::decay_t<CoroFunc>>{
40 std::forward<CoroFunc>(coro)};
54 return detail::PushHelper<Channel>{channel};
65inline auto fixed(
int fd) {
return detail::FixedFd{fd}; }
76template <BufferLike Buffer>
auto fixed(
int buf_index, Buffer &&buf) {
77 return detail::FixedBuffer<Buffer>{std::forward<Buffer>(buf), buf_index};
88inline auto fixed(
int buf_index,
const struct iovec *iov) {
89 return detail::FixedBuffer<const iovec *>{iov, buf_index};
100inline auto fixed(
int buf_index,
const struct msghdr *msg) {
101 return detail::FixedBuffer<const msghdr *>{msg, buf_index};
Thread-safe bounded channel for communication and synchronization.
Helper functions for asynchronous operations.
The main namespace for the Condy library.
auto will_spawn(CoroFunc &&coro)
Helper to build an invocable that spawns a coroutine on invocation.
auto fixed(int fd)
Mark a file descriptor as fixed for io_uring operations.
auto will_push(Channel &channel)
Helper to build an invocable that pushes the result to a channel on invocation.