15#if CONDY_URING_VERSION_GE(2, 4)
19#define CONDY_FILE_INDEX_ALLOC IORING_FILE_INDEX_ALLOC
24#define CONDY_FILE_INDEX_ALLOC (IORING_FILE_INDEX_ALLOC - 1)
43template <
typename CoroFunc>
auto will_spawn(CoroFunc &&coro) {
44 return detail::SpawnHelper<std::decay_t<CoroFunc>>{
45 std::forward<CoroFunc>(coro)};
59 return detail::PushHelper<Channel>{channel};
70inline auto fixed(
int fd) {
return detail::FixedFd{fd}; }
81template <BufferLike Buffer>
auto fixed(
int buf_index, Buffer &&buf) {
82 return detail::FixedBuffer<Buffer>{std::forward<Buffer>(buf), buf_index};
93inline auto fixed(
int buf_index,
const struct iovec *iov) {
94 return detail::FixedBuffer<const iovec *>{iov, buf_index};
105inline auto fixed(
int buf_index,
const struct msghdr *msg) {
106 return detail::FixedBuffer<const msghdr *>{msg, buf_index};
Thread-safe bounded channel for communication and synchronization.
Helper functions for asynchronous operations.
#define CONDY_FILE_INDEX_ALLOC
Placeholder to let io_uring allocate a direct file descriptor.
The main namespace for the Condy library.
auto will_spawn(CoroFunc &&coro)
Helper to build an invocable that spawns a coroutine on invocation.
constexpr unsigned file_index_alloc
Placeholder to let io_uring allocate a direct file descriptor.
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.