21template <AwaiterLike Awaiter>
22auto maybe_flag_fixed_fd(Awaiter &&op,
const FixedFd &) {
26template <AwaiterLike Awaiter>
auto maybe_flag_fixed_fd(Awaiter &&op,
int) {
27 return std::forward<Awaiter>(op);
31constexpr bool is_fixed_fd_v = std::is_same_v<std::decay_t<Fd>, FixedFd>;
38template <FdLike Fd1, FdLike Fd2>
39inline auto async_splice(Fd1 fd_in, int64_t off_in, Fd2 fd_out, int64_t off_out,
40 unsigned int nbytes,
unsigned int splice_flags) {
41 if constexpr (detail::is_fixed_fd_v<Fd1>) {
42 splice_flags |= SPLICE_F_FD_IN_FIXED;
45 off_out, nbytes, splice_flags);
46 return detail::maybe_flag_fixed_fd(std::move(op), fd_out);
52template <FdLike Fd1, FdLike Fd2>
53inline auto async_tee(Fd1 fd_in, Fd2 fd_out,
unsigned int nbytes,
54 unsigned int splice_flags) {
55 if constexpr (detail::is_fixed_fd_v<Fd1>) {
56 splice_flags |= SPLICE_F_FD_IN_FIXED;
59 make_op_awaiter(io_uring_prep_tee, fd_in, fd_out, nbytes, splice_flags);
60 return detail::maybe_flag_fixed_fd(std::move(op), fd_out);
67inline auto async_readv(Fd fd,
const struct iovec *iovecs,
unsigned nr_vecs,
68 __u64 offset,
int flags) {
69 auto op =
make_op_awaiter(io_uring_prep_readv2, fd, iovecs, nr_vecs, offset,
71 return detail::maybe_flag_fixed_fd(std::move(op), fd);
74#if !IO_URING_CHECK_VERSION(2, 10)
79inline auto async_readv(Fd fd, detail::FixedBuffer<const iovec *> iovecs,
80 unsigned nr_vecs, __u64 offset,
int flags) {
82 nr_vecs, offset, flags, iovecs.buf_index);
83 return detail::maybe_flag_fixed_fd(std::move(op), fd);
92 unsigned int nr_vecs, __u64 offset,
int flags) {
95 return detail::maybe_flag_fixed_fd(std::move(op), fd);
98#if !IO_URING_CHECK_VERSION(2, 10)
103inline auto async_writev(Fd fd, detail::FixedBuffer<const iovec *> iovecs,
104 unsigned int nr_vecs, __u64 offset,
int flags) {
105 auto op =
make_op_awaiter(io_uring_prep_writev_fixed, fd, iovecs.value,
106 nr_vecs, offset, flags, iovecs.buf_index);
107 return detail::maybe_flag_fixed_fd(std::move(op), fd);
117 return detail::maybe_flag_fixed_fd(std::move(op), fd);
123template <FdLike Fd,
typename MultiShotFunc, NotBundledBufferRing Buffer>
125 Buffer &buf, MultiShotFunc &&func) {
127 std::forward<MultiShotFunc>(func), &buf,
128 io_uring_prep_recvmsg_multishot, fd, msg, flags);
129 return detail::maybe_flag_fixed_fd(std::move(op), fd);
138 return detail::maybe_flag_fixed_fd(std::move(op), fd);
144template <FdLike Fd,
typename FreeFunc>
148 std::forward<FreeFunc>(func), io_uring_prep_sendmsg_zc, fd, msg, flags);
149 return detail::maybe_flag_fixed_fd(std::move(op), fd);
152#if !IO_URING_CHECK_VERSION(2, 10)
156template <FdLike Fd,
typename FreeFunc>
158 unsigned flags, FreeFunc &&func) {
160 io_uring_prep_sendmsg_zc_fixed, fd,
161 msg.value, flags, msg.buf_index);
162 return detail::maybe_flag_fixed_fd(std::move(op), fd);
169template <FdLike Fd>
inline auto async_fsync(Fd fd,
unsigned fsync_flags) {
171 return detail::maybe_flag_fixed_fd(std::move(op), fd);
179#if !IO_URING_CHECK_VERSION(2, 13)
194#if !IO_URING_CHECK_VERSION(2, 4)
199template <
typename MultiShotFunc>
201 unsigned count,
unsigned flags,
202 MultiShotFunc &&func) {
204 io_uring_prep_timeout, ts, count,
205 flags | IORING_TIMEOUT_MULTISHOT);
213inline auto async_accept(Fd fd,
struct sockaddr *addr, socklen_t *addrlen,
215 auto op =
make_op_awaiter(io_uring_prep_accept, fd, addr, addrlen, flags);
216 return detail::maybe_flag_fixed_fd(std::move(op), fd);
224 socklen_t *addrlen,
int flags,
225 unsigned int file_index) {
226 auto op =
make_op_awaiter(io_uring_prep_accept_direct, fd, addr, addrlen,
228 return detail::maybe_flag_fixed_fd(std::move(op), fd);
234template <FdLike Fd,
typename MultiShotFunc>
236 socklen_t *addrlen,
int flags,
237 MultiShotFunc &&func) {
239 io_uring_prep_multishot_accept, fd,
240 addr, addrlen, flags);
241 return detail::maybe_flag_fixed_fd(std::move(op), fd);
247template <FdLike Fd,
typename MultiShotFunc>
249 socklen_t *addrlen,
int flags,
250 MultiShotFunc &&func) {
252 io_uring_prep_multishot_accept_direct,
253 fd, addr, addrlen, flags);
254 return detail::maybe_flag_fixed_fd(std::move(op), fd);
261 if constexpr (detail::is_fixed_fd_v<Fd>) {
262 flags |= IORING_ASYNC_CANCEL_FD_FIXED;
281 return detail::maybe_flag_fixed_fd(std::move(op), fd);
288 return make_op_awaiter(io_uring_prep_files_update, fds, nr_fds, offset);
296 auto op =
make_op_awaiter(io_uring_prep_fallocate, fd, mode, offset, len);
297 return detail::maybe_flag_fixed_fd(std::move(op), fd);
303inline auto async_openat(
int dfd,
const char *path,
int flags, mode_t mode) {
311 mode_t mode,
unsigned file_index) {
312 return make_op_awaiter(io_uring_prep_openat_direct, dfd, path, flags, mode,
319inline auto async_open(
const char *path,
int flags, mode_t mode) {
327 unsigned file_index) {
348template <FdLike Fd, BufferLike Buffer>
351 make_op_awaiter(io_uring_prep_read, fd, buf.data(), buf.size(), offset);
352 return detail::maybe_flag_fixed_fd(std::move(op), fd);
358template <FdLike Fd, BufferLike Buffer>
359inline auto async_read(Fd fd, detail::FixedBuffer<Buffer> buf, __u64 offset) {
360 auto op =
make_op_awaiter(io_uring_prep_read_fixed, fd, buf.value.data(),
361 buf.value.size(), offset, buf.buf_index);
362 return detail::maybe_flag_fixed_fd(std::move(op), fd);
368template <FdLike Fd, NotBundledBufferRing Buffer>
372 return detail::maybe_flag_fixed_fd(std::move(op), fd);
375#if !IO_URING_CHECK_VERSION(2, 6)
379template <FdLike Fd, NotBundledBufferRing Buffer,
typename MultiShotFunc>
381 MultiShotFunc &&func) {
383 std::forward<MultiShotFunc>(func), &buf, io_uring_prep_read_multishot,
384 fd, 0, offset, buf.bgid());
385 return detail::maybe_flag_fixed_fd(std::move(op), fd);
392template <FdLike Fd, BufferLike Buffer>
394 auto op =
make_op_awaiter(io_uring_prep_write, fd, buf.data(), buf.size(),
396 return detail::maybe_flag_fixed_fd(std::move(op), fd);
402template <FdLike Fd, BufferLike Buffer>
403inline auto async_write(Fd fd, detail::FixedBuffer<Buffer> buf, __u64 offset) {
404 auto op =
make_op_awaiter(io_uring_prep_write_fixed, fd, buf.value.data(),
405 buf.value.size(), offset, buf.buf_index);
406 return detail::maybe_flag_fixed_fd(std::move(op), fd);
412inline auto async_statx(
int dfd,
const char *path,
int flags,
unsigned mask,
413 struct statx *statxbuf) {
423 auto op =
make_op_awaiter(io_uring_prep_fadvise, fd, offset, len, advice);
424 return detail::maybe_flag_fixed_fd(std::move(op), fd);
427#if !IO_URING_CHECK_VERSION(2, 7)
433 auto op =
make_op_awaiter(io_uring_prep_fadvise64, fd, offset, len, advice);
434 return detail::maybe_flag_fixed_fd(std::move(op), fd);
445#if !IO_URING_CHECK_VERSION(2, 7)
450 auto op =
make_op_awaiter(io_uring_prep_madvise64, addr, length, advice);
457inline void prep_sendto(io_uring_sqe *sqe,
int sockfd,
const void *buf,
458 size_t len,
int flags,
const struct sockaddr *addr,
460 io_uring_prep_send(sqe, sockfd, buf, len, flags);
461 io_uring_prep_send_set_addr(sqe, addr, addrlen);
464inline void prep_send_fixed(io_uring_sqe *sqe,
int sockfd,
const void *buf,
465 size_t len,
int flags,
int buf_index) {
466 io_uring_prep_send(sqe, sockfd, buf, len, flags);
467 sqe->ioprio |= IORING_RECVSEND_FIXED_BUF;
468 sqe->buf_index = buf_index;
471inline void prep_sendto_fixed(io_uring_sqe *sqe,
int sockfd,
const void *buf,
472 size_t len,
int flags,
473 const struct sockaddr *addr, socklen_t addrlen,
475 prep_sendto(sqe, sockfd, buf, len, flags, addr, addrlen);
476 sqe->ioprio |= IORING_RECVSEND_FIXED_BUF;
477 sqe->buf_index = buf_index;
480inline void prep_sendto_zc(io_uring_sqe *sqe,
int sockfd,
const void *buf,
481 size_t len,
int flags,
const struct sockaddr *addr,
482 socklen_t addrlen,
unsigned zc_flags) {
483 io_uring_prep_send_zc(sqe, sockfd, buf, len, flags, zc_flags);
484 io_uring_prep_send_set_addr(sqe, addr, addrlen);
487inline void prep_sendto_zc_fixed(io_uring_sqe *sqe,
int sockfd,
const void *buf,
488 size_t len,
int flags,
489 const struct sockaddr *addr, socklen_t addrlen,
490 unsigned zc_flags,
int buf_index) {
491 prep_sendto_zc(sqe, sockfd, buf, len, flags, addr, addrlen, zc_flags);
492 sqe->ioprio |= IORING_RECVSEND_FIXED_BUF;
493 sqe->buf_index = buf_index;
501template <FdLike Fd, BufferLike Buffer>
505 return detail::maybe_flag_fixed_fd(std::move(op), sockfd);
515 return detail::maybe_flag_fixed_fd(std::move(op), sockfd);
518#if !IO_URING_CHECK_VERSION(2, 7)
523inline auto async_send(Fd sockfd, BundledProvidedBufferQueue &buf,
int flags) {
525 sockfd,
nullptr, 0, flags);
526 return detail::maybe_flag_fixed_fd(std::move(op), sockfd);
533template <FdLike Fd, BufferLike Buffer>
535 const struct sockaddr *addr, socklen_t addrlen) {
537 buf.size(), flags, addr, addrlen);
538 return detail::maybe_flag_fixed_fd(std::move(op), sockfd);
546 const struct sockaddr *addr, socklen_t addrlen) {
548 nullptr, 0, flags, addr, addrlen);
549 return detail::maybe_flag_fixed_fd(std::move(op), sockfd);
552#if !IO_URING_CHECK_VERSION(2, 7)
557inline auto async_sendto(Fd sockfd, BundledProvidedBufferQueue &buf,
int flags,
558 const struct sockaddr *addr, socklen_t addrlen) {
560 &buf, detail::prep_sendto, sockfd,
nullptr, 0, flags, addr, addrlen);
561 return detail::maybe_flag_fixed_fd(std::move(op), sockfd);
568template <FdLike Fd,
typename Buffer,
typename FreeFunc>
569inline auto async_send_zc(Fd sockfd, Buffer &&buf,
int flags,
unsigned zc_flags,
572 std::forward<FreeFunc>(func), io_uring_prep_send_zc, sockfd, buf.data(),
573 buf.size(), flags, zc_flags);
574 return detail::maybe_flag_fixed_fd(std::move(op), sockfd);
580template <FdLike Fd, BufferLike Buffer,
typename FreeFunc>
581inline auto async_send_zc(Fd sockfd, detail::FixedBuffer<Buffer> buf,
int flags,
582 unsigned zc_flags, FreeFunc &&func) {
584 std::forward<FreeFunc>(func), io_uring_prep_send_zc_fixed, sockfd,
585 buf.value.data(), buf.value.size(), flags, zc_flags, buf.buf_index);
586 return detail::maybe_flag_fixed_fd(std::move(op), sockfd);
592template <FdLike Fd, BufferLike Buffer,
typename FreeFunc>
594 const struct sockaddr *addr, socklen_t addrlen,
595 unsigned zc_flags, FreeFunc &&func) {
597 std::forward<FreeFunc>(func), detail::prep_sendto_zc, sockfd,
598 buf.data(), buf.size(), flags, addr, addrlen, zc_flags);
599 return detail::maybe_flag_fixed_fd(std::move(op), sockfd);
605template <FdLike Fd, BufferLike Buffer,
typename FreeFunc>
607 int flags,
const struct sockaddr *addr,
608 socklen_t addrlen,
unsigned zc_flags,
611 std::forward<FreeFunc>(func), detail::prep_sendto_zc_fixed, sockfd,
612 buf.value.data(), buf.value.size(), flags, addr, addrlen, zc_flags,
614 return detail::maybe_flag_fixed_fd(std::move(op), sockfd);
620template <FdLike Fd, BufferLike Buffer>
624 return detail::maybe_flag_fixed_fd(std::move(op), sockfd);
630template <FdLike Fd, NotBundledBufferRing Buffer>
634 return detail::maybe_flag_fixed_fd(std::move(op), sockfd);
637#if !IO_URING_CHECK_VERSION(2, 7)
641template <FdLike Fd, BundledBufferRing Buffer>
644 sockfd,
nullptr, 0, flags);
645 return detail::maybe_flag_fixed_fd(std::move(op), sockfd);
652template <FdLike Fd, NotBundledBufferRing Buffer,
typename MultiShotFunc>
654 MultiShotFunc &&func) {
656 std::forward<MultiShotFunc>(func), &buf, io_uring_prep_recv_multishot,
657 sockfd,
nullptr, 0, flags);
658 return detail::maybe_flag_fixed_fd(std::move(op), sockfd);
661#if !IO_URING_CHECK_VERSION(2, 7)
665template <FdLike Fd, BundledBufferRing Buffer,
typename MultiShotFunc>
667 MultiShotFunc &&func) {
669 std::forward<MultiShotFunc>(func), &buf, io_uring_prep_recv_multishot,
670 sockfd,
nullptr, 0, flags);
671 return detail::maybe_flag_fixed_fd(std::move(op), sockfd);
686 struct open_how *how,
unsigned file_index) {
696 return detail::maybe_flag_fixed_fd(std::move(op), fd);
717 const char *newpath,
unsigned int flags) {
718 return make_op_awaiter(io_uring_prep_renameat, olddfd, oldpath, newdfd,
736 make_op_awaiter(io_uring_prep_sync_file_range, fd, len, offset, flags);
737 return detail::maybe_flag_fixed_fd(std::move(op), fd);
758 const char *linkpath) {
759 return make_op_awaiter(io_uring_prep_symlinkat, target, newdirfd, linkpath);
773 const char *newpath,
int flags) {
781inline auto async_link(
const char *oldpath,
const char *newpath,
int flags) {
782 return async_linkat(AT_FDCWD, oldpath, AT_FDCWD, newpath, flags);
790 return make_op_awaiter(io_uring_prep_getxattr, name, value, path, len);
797 const char *path,
int flags,
unsigned int len) {
798 return make_op_awaiter(io_uring_prep_setxattr, name, value, path, flags,
814 int flags,
unsigned int len) {
815 return make_op_awaiter(io_uring_prep_fsetxattr, fd, name, value, flags,
823 unsigned int flags) {
824 return make_op_awaiter(io_uring_prep_socket, domain, type, protocol, flags);
831 unsigned file_index,
unsigned int flags) {
832 return make_op_awaiter(io_uring_prep_socket_direct, domain, type, protocol,
836#if !IO_URING_CHECK_VERSION(2, 5)
842 void *optval,
int optlen) {
844 optname, optval, optlen);
845 return detail::maybe_flag_fixed_fd(std::move(op), fd);
849#if !IO_URING_CHECK_VERSION(2, 13)
855 socklen_t *sockaddr_len,
int peer) {
858 return detail::maybe_flag_fixed_fd(std::move(op), fd);
862#if !IO_URING_CHECK_VERSION(2, 6)
867 int options,
unsigned int flags) {
868 return make_op_awaiter(io_uring_prep_waitid, idtype,
id, infop, options,
873#if !IO_URING_CHECK_VERSION(2, 6)
878 uint32_t futex_flags,
unsigned int flags) {
884#if !IO_URING_CHECK_VERSION(2, 6)
889 uint32_t futex_flags,
unsigned int flags) {
895#if !IO_URING_CHECK_VERSION(2, 6)
900 unsigned int flags) {
901 return make_op_awaiter(io_uring_prep_futex_waitv, futex, nr_futex, flags);
905#if !IO_URING_CHECK_VERSION(2, 6)
910 return make_op_awaiter(io_uring_prep_fixed_fd_install, fixed_fd, flags);
914#if !IO_URING_CHECK_VERSION(2, 4)
919 unsigned int flags) {
920 void *payload =
nullptr;
923 payload =
reinterpret_cast<void *
>((target_fd + 1) << 3);
926 io_uring_prep_msg_ring_fd, dst.ring_.ring_fd, source_fd, target_fd,
927 reinterpret_cast<uint64_t
>(encode_work(payload, WorkType::SendFd)),
932#if !IO_URING_CHECK_VERSION(2, 6)
938 return detail::maybe_flag_fixed_fd(std::move(op), fd);
942#if !IO_URING_CHECK_VERSION(2, 8)
948 auto op =
make_op_awaiter(io_uring_prep_cmd_discard, fd, offset, nbytes);
949 return detail::maybe_flag_fixed_fd(std::move(op), fd);
953#if !IO_URING_CHECK_VERSION(2, 7)
958inline auto async_bind(Fd fd,
struct sockaddr *addr, socklen_t addrlen) {
960 return detail::maybe_flag_fixed_fd(std::move(op), fd);
964#if !IO_URING_CHECK_VERSION(2, 7)
970 return detail::maybe_flag_fixed_fd(std::move(op), fd);
981#if !IO_URING_CHECK_VERSION(2, 10)
987 return make_op_awaiter(io_uring_prep_epoll_wait, fd, events, maxevents,
992#if !IO_URING_CHECK_VERSION(2, 12)
1001#if !IO_URING_CHECK_VERSION(2, 12)
1006 unsigned int file_index) {
Helper functions for composing asynchronous operations.
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 async_read_multishot(Fd fd, Buffer &buf, __u64 offset, MultiShotFunc &&func)
See io_uring_prep_read_multishot.
auto make_multishot_select_buffer_op_awaiter(MultiShotFunc &&multishot_func, Br *buffers, Func &&func, Args &&...args)
This function creates a variant of OpAwaiter. OpAwaiter represents an asynchronous operation that can...
auto async_symlinkat(const char *target, int newdirfd, const char *linkpath)
See io_uring_prep_symlinkat.
auto make_op_awaiter(Func &&func, Args &&...args)
This function creates a variant of OpAwaiter. OpAwaiter represents an asynchronous operation that can...
auto async_splice(Fd1 fd_in, int64_t off_in, Fd2 fd_out, int64_t off_out, unsigned int nbytes, unsigned int splice_flags)
See io_uring_prep_splice.
auto async_fsetxattr(int fd, const char *name, const char *value, int flags, unsigned int len)
See io_uring_prep_fsetxattr.
auto async_fadvise(Fd fd, __u64 offset, off_t len, int advice)
See io_uring_prep_fadvise.
auto async_writev(Fd fd, const struct iovec *iovecs, unsigned int nr_vecs, __u64 offset, int flags)
See io_uring_prep_writev2.
auto async_fixed_fd_install(int fixed_fd, unsigned int flags)
See io_uring_prep_fixed_fd_install.
auto make_bundle_select_buffer_op_awaiter(Br *buffers, Func &&func, Args &&...args)
This function creates a variant of OpAwaiter. OpAwaiter represents an asynchronous operation that can...
auto async_socket_direct(int domain, int type, int protocol, unsigned file_index, unsigned int flags)
See io_uring_prep_socket_direct.
auto async_madvise64(void *addr, off_t length, int advice)
See io_uring_prep_madvise64.
auto async_fsync(Fd fd, unsigned fsync_flags)
See io_uring_prep_fsync.
auto async_cmd_getsockname(Fd fd, struct sockaddr *sockaddr, socklen_t *sockaddr_len, int peer)
See io_uring_prep_cmd_getsockname.
auto async_ftruncate(Fd fd, loff_t len)
See io_uring_prep_ftruncate.
auto async_recvmsg(Fd fd, struct msghdr *msg, unsigned flags)
See io_uring_prep_recvmsg.
auto async_openat2(int dfd, const char *path, struct open_how *how)
See io_uring_prep_openat2.
auto async_nop128()
See io_uring_prep_nop128.
auto async_open_direct(const char *path, int flags, mode_t mode, unsigned file_index)
See io_uring_prep_openat_direct.
auto async_write(Fd fd, Buffer &&buf, __u64 offset)
See io_uring_prep_write.
auto async_getxattr(const char *name, char *value, const char *path, unsigned int len)
See io_uring_prep_getxattr.
auto async_unlinkat(int dfd, const char *path, int flags)
See io_uring_prep_unlinkat.
auto make_multishot_op_awaiter(MultiShotFunc &&multishot_func, Func &&func, Args &&...args)
This function creates a variant of OpAwaiter. OpAwaiter represents an asynchronous operation that can...
auto async_openat_direct(int dfd, const char *path, int flags, mode_t mode, unsigned file_index)
See io_uring_prep_openat_direct.
auto async_epoll_ctl(int epfd, int fd, int op, struct epoll_event *ev)
See io_uring_prep_epoll_ctl.
auto async_mkdir(const char *path, mode_t mode)
See io_uring_prep_mkdirat.
auto async_fgetxattr(int fd, const char *name, char *value, unsigned int len)
See io_uring_prep_fgetxattr.
auto async_statx(int dfd, const char *path, int flags, unsigned mask, struct statx *statxbuf)
See io_uring_prep_statx.
auto async_sendto_zc(Fd sockfd, Buffer &&buf, int flags, const struct sockaddr *addr, socklen_t addrlen, unsigned zc_flags, FreeFunc &&func)
See io_uring_prep_send_zc and io_uring_prep_send_set_addr.
auto make_zero_copy_op_awaiter(FreeFunc &&free_func, Func &&func, Args &&...args)
This function creates a variant of OpAwaiter. OpAwaiter represents an asynchronous operation that can...
auto async_cmd_discard(Fd fd, uint64_t offset, uint64_t nbytes)
See io_uring_prep_cmd_discard.
auto async_link(const char *oldpath, const char *newpath, int flags)
See io_uring_prep_linkat.
auto async_multishot_accept_direct(Fd fd, struct sockaddr *addr, socklen_t *addrlen, int flags, MultiShotFunc &&func)
See io_uring_prep_multishot_accept_direct.
auto async_sendto(Fd sockfd, Buffer &&buf, int flags, const struct sockaddr *addr, socklen_t addrlen)
See io_uring_prep_send and io_uring_prep_send_set_addr.
auto async_futex_wake(uint32_t *futex, uint64_t val, uint64_t mask, uint32_t futex_flags, unsigned int flags)
See io_uring_prep_futex_wake.
auto make_op_awaiter128(Func &&func, Args &&...args)
This function creates a variant of OpAwaiter. OpAwaiter represents an asynchronous operation that can...
auto async_recv_multishot(Fd sockfd, Buffer &buf, int flags, MultiShotFunc &&func)
See io_uring_prep_recv_multishot.
auto async_recv(Fd sockfd, Buffer &&buf, int flags)
See io_uring_prep_recv.
auto async_multishot_accept(Fd fd, struct sockaddr *addr, socklen_t *addrlen, int flags, MultiShotFunc &&func)
See io_uring_prep_multishot_accept.
auto make_select_buffer_op_awaiter(Br *buffers, Func &&func, Args &&...args)
This function creates a variant of OpAwaiter. OpAwaiter represents an asynchronous operation that can...
auto async_fallocate(Fd fd, int mode, __u64 offset, __u64 len)
See io_uring_prep_fallocate.
auto async_madvise(void *addr, __u32 length, int advice)
See io_uring_prep_madvise.
auto async_epoll_wait(int fd, struct epoll_event *events, int maxevents, unsigned flags)
See io_uring_prep_epoll_wait.
auto async_symlink(const char *target, const char *linkpath)
See io_uring_prep_symlinkat.
auto async_sync_file_range(Fd fd, unsigned len, __u64 offset, int flags)
See io_uring_prep_sync_file_range.
auto async_fadvise64(Fd fd, __u64 offset, off_t len, int advice)
See io_uring_prep_fadvise64.
auto async_bind(Fd fd, struct sockaddr *addr, socklen_t addrlen)
See io_uring_prep_bind.
auto async_connect(Fd fd, const struct sockaddr *addr, socklen_t addrlen)
See io_uring_prep_connect.
auto async_waitid(idtype_t idtype, id_t id, siginfo_t *infop, int options, unsigned int flags)
See io_uring_prep_waitid.
auto async_files_update(int *fds, unsigned nr_fds, int offset)
See io_uring_prep_files_update.
auto async_cmd_sock(int cmd_op, Fd fd, int level, int optname, void *optval, int optlen)
See io_uring_prep_cmd_sock.
auto async_tee(Fd1 fd_in, Fd2 fd_out, unsigned int nbytes, unsigned int splice_flags)
See io_uring_prep_tee.
auto async_recvmsg_multishot(Fd fd, struct msghdr *msg, unsigned flags, Buffer &buf, MultiShotFunc &&func)
See io_uring_prep_recvmsg_multishot.
auto async_futex_wait(uint32_t *futex, uint64_t val, uint64_t mask, uint32_t futex_flags, unsigned int flags)
See io_uring_prep_futex_wait.
auto async_sendmsg(Fd fd, const struct msghdr *msg, unsigned flags)
See io_uring_prep_sendmsg.
auto async_read(Fd fd, Buffer &&buf, __u64 offset)
See io_uring_prep_read.
auto async_cancel_fd(Fd fd, unsigned int flags)
See io_uring_prep_cancel_fd.
auto async_pipe_direct(int *fds, int pipe_flags, unsigned int file_index)
See io_uring_prep_pipe_direct.
auto async_link_timeout(struct __kernel_timespec *ts, unsigned flags)
See io_uring_prep_link_timeout.
auto async_nop()
See io_uring_prep_nop.
auto async_sendmsg_zc(Fd fd, const struct msghdr *msg, unsigned flags, FreeFunc &&func)
See io_uring_prep_sendmsg_zc.
auto async_close(int fd)
See io_uring_prep_close.
auto async_open(const char *path, int flags, mode_t mode)
See io_uring_prep_openat.
auto flag(Awaiter &&awaiter)
Decorates an awaiter with specific io_uring sqe flags.
auto async_listen(Fd fd, int backlog)
See io_uring_prep_listen.
auto async_send(Fd sockfd, Buffer &&buf, int flags)
See io_uring_prep_send.
auto async_renameat(int olddfd, const char *oldpath, int newdfd, const char *newpath, unsigned int flags)
See io_uring_prep_renameat.
auto async_accept_direct(Fd fd, struct sockaddr *addr, socklen_t *addrlen, int flags, unsigned int file_index)
See io_uring_prep_accept_direct.
auto async_timeout(struct __kernel_timespec *ts, unsigned count, unsigned flags)
See io_uring_prep_timeout.
auto async_rename(const char *oldpath, const char *newpath)
See io_uring_prep_renameat.
auto async_setxattr(const char *name, const char *value, const char *path, int flags, unsigned int len)
See io_uring_prep_setxattr.
auto async_send_zc(Fd sockfd, Buffer &&buf, int flags, unsigned zc_flags, FreeFunc &&func)
See io_uring_prep_send_zc.
auto async_openat2_direct(int dfd, const char *path, struct open_how *how, unsigned file_index)
See io_uring_prep_openat2_direct.
auto async_unlink(const char *path, int flags)
See io_uring_prep_unlinkat.
auto async_accept(Fd fd, struct sockaddr *addr, socklen_t *addrlen, int flags)
See io_uring_prep_accept.
auto async_mkdirat(int dfd, const char *path, mode_t mode)
See io_uring_prep_mkdirat.
auto async_readv(Fd fd, const struct iovec *iovecs, unsigned nr_vecs, __u64 offset, int flags)
See io_uring_prep_readv2.
auto async_openat(int dfd, const char *path, int flags, mode_t mode)
See io_uring_prep_openat.
auto make_multishot_bundle_select_buffer_op_awaiter(MultiShotFunc &&multishot_func, Br *buffers, Func &&func, Args &&...args)
This function creates a variant of OpAwaiter. OpAwaiter represents an asynchronous operation that can...
auto async_timeout_multishot(struct __kernel_timespec *ts, unsigned count, unsigned flags, MultiShotFunc &&func)
See io_uring_prep_timeout.
auto async_linkat(int olddfd, const char *oldpath, int newdfd, const char *newpath, int flags)
See io_uring_prep_linkat.
auto async_pipe(int *fds, int pipe_flags)
See io_uring_prep_pipe.
auto async_fixed_fd_send(FdTable &dst, int source_fd, int target_fd, unsigned int flags)
See io_uring_prep_msg_ring_fd.
auto async_futex_waitv(struct futex_waitv *futex, uint32_t nr_futex, unsigned int flags)
See io_uring_prep_futex_waitv.
auto async_shutdown(Fd fd, int how)
See io_uring_prep_shutdown.
auto async_socket(int domain, int type, int protocol, unsigned int flags)
See io_uring_prep_socket.
Support for io_uring provided buffers.