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);
187#if !IO_URING_CHECK_VERSION(2, 4)
192template <
typename MultiShotFunc>
194 unsigned count,
unsigned flags,
195 MultiShotFunc &&func) {
197 io_uring_prep_timeout, ts, count,
198 flags | IORING_TIMEOUT_MULTISHOT);
206inline auto async_accept(Fd fd,
struct sockaddr *addr, socklen_t *addrlen,
208 auto op =
make_op_awaiter(io_uring_prep_accept, fd, addr, addrlen, flags);
209 return detail::maybe_flag_fixed_fd(std::move(op), fd);
217 socklen_t *addrlen,
int flags,
218 unsigned int file_index) {
219 auto op =
make_op_awaiter(io_uring_prep_accept_direct, fd, addr, addrlen,
221 return detail::maybe_flag_fixed_fd(std::move(op), fd);
227template <FdLike Fd,
typename MultiShotFunc>
229 socklen_t *addrlen,
int flags,
230 MultiShotFunc &&func) {
232 io_uring_prep_multishot_accept, fd,
233 addr, addrlen, flags);
234 return detail::maybe_flag_fixed_fd(std::move(op), fd);
240template <FdLike Fd,
typename MultiShotFunc>
242 socklen_t *addrlen,
int flags,
243 MultiShotFunc &&func) {
245 io_uring_prep_multishot_accept_direct,
246 fd, addr, addrlen, flags);
247 return detail::maybe_flag_fixed_fd(std::move(op), fd);
254 if constexpr (detail::is_fixed_fd_v<Fd>) {
255 flags |= IORING_ASYNC_CANCEL_FD_FIXED;
274 return detail::maybe_flag_fixed_fd(std::move(op), fd);
281 return make_op_awaiter(io_uring_prep_files_update, fds, nr_fds, offset);
289 auto op =
make_op_awaiter(io_uring_prep_fallocate, fd, mode, offset, len);
290 return detail::maybe_flag_fixed_fd(std::move(op), fd);
296inline auto async_openat(
int dfd,
const char *path,
int flags, mode_t mode) {
304 mode_t mode,
unsigned file_index) {
305 return make_op_awaiter(io_uring_prep_openat_direct, dfd, path, flags, mode,
312inline auto async_open(
const char *path,
int flags, mode_t mode) {
320 unsigned file_index) {
341template <FdLike Fd, BufferLike Buffer>
344 make_op_awaiter(io_uring_prep_read, fd, buf.data(), buf.size(), offset);
345 return detail::maybe_flag_fixed_fd(std::move(op), fd);
351template <FdLike Fd, BufferLike Buffer>
352inline auto async_read(Fd fd, detail::FixedBuffer<Buffer> buf, __u64 offset) {
353 auto op =
make_op_awaiter(io_uring_prep_read_fixed, fd, buf.value.data(),
354 buf.value.size(), offset, buf.buf_index);
355 return detail::maybe_flag_fixed_fd(std::move(op), fd);
361template <FdLike Fd, NotBundledBufferRing Buffer>
365 return detail::maybe_flag_fixed_fd(std::move(op), fd);
368#if !IO_URING_CHECK_VERSION(2, 6)
372template <FdLike Fd, NotBundledBufferRing Buffer,
typename MultiShotFunc>
374 MultiShotFunc &&func) {
376 std::forward<MultiShotFunc>(func), &buf, io_uring_prep_read_multishot,
377 fd, 0, offset, buf.bgid());
378 return detail::maybe_flag_fixed_fd(std::move(op), fd);
385template <FdLike Fd, BufferLike Buffer>
387 auto op =
make_op_awaiter(io_uring_prep_write, fd, buf.data(), buf.size(),
389 return detail::maybe_flag_fixed_fd(std::move(op), fd);
395template <FdLike Fd, BufferLike Buffer>
396inline auto async_write(Fd fd, detail::FixedBuffer<Buffer> buf, __u64 offset) {
397 auto op =
make_op_awaiter(io_uring_prep_write_fixed, fd, buf.value.data(),
398 buf.value.size(), offset, buf.buf_index);
399 return detail::maybe_flag_fixed_fd(std::move(op), fd);
405inline auto async_statx(
int dfd,
const char *path,
int flags,
unsigned mask,
406 struct statx *statxbuf) {
416 auto op =
make_op_awaiter(io_uring_prep_fadvise, fd, offset, len, advice);
417 return detail::maybe_flag_fixed_fd(std::move(op), fd);
420#if !IO_URING_CHECK_VERSION(2, 7)
426 auto op =
make_op_awaiter(io_uring_prep_fadvise64, fd, offset, len, advice);
427 return detail::maybe_flag_fixed_fd(std::move(op), fd);
438#if !IO_URING_CHECK_VERSION(2, 7)
443 auto op =
make_op_awaiter(io_uring_prep_madvise64, addr, length, advice);
450inline void prep_sendto(io_uring_sqe *sqe,
int sockfd,
const void *buf,
451 size_t len,
int flags,
const struct sockaddr *addr,
453 io_uring_prep_send(sqe, sockfd, buf, len, flags);
454 io_uring_prep_send_set_addr(sqe, addr, addrlen);
457inline void prep_send_fixed(io_uring_sqe *sqe,
int sockfd,
const void *buf,
458 size_t len,
int flags,
int buf_index) {
459 io_uring_prep_send(sqe, sockfd, buf, len, flags);
460 sqe->ioprio |= IORING_RECVSEND_FIXED_BUF;
461 sqe->buf_index = buf_index;
464inline void prep_sendto_fixed(io_uring_sqe *sqe,
int sockfd,
const void *buf,
465 size_t len,
int flags,
466 const struct sockaddr *addr, socklen_t addrlen,
468 prep_sendto(sqe, sockfd, buf, len, flags, addr, addrlen);
469 sqe->ioprio |= IORING_RECVSEND_FIXED_BUF;
470 sqe->buf_index = buf_index;
473inline void prep_sendto_zc(io_uring_sqe *sqe,
int sockfd,
const void *buf,
474 size_t len,
int flags,
const struct sockaddr *addr,
475 socklen_t addrlen,
unsigned zc_flags) {
476 io_uring_prep_send_zc(sqe, sockfd, buf, len, flags, zc_flags);
477 io_uring_prep_send_set_addr(sqe, addr, addrlen);
480inline void prep_sendto_zc_fixed(io_uring_sqe *sqe,
int sockfd,
const void *buf,
481 size_t len,
int flags,
482 const struct sockaddr *addr, socklen_t addrlen,
483 unsigned zc_flags,
int buf_index) {
484 prep_sendto_zc(sqe, sockfd, buf, len, flags, addr, addrlen, zc_flags);
485 sqe->ioprio |= IORING_RECVSEND_FIXED_BUF;
486 sqe->buf_index = buf_index;
494template <FdLike Fd, BufferLike Buffer>
498 return detail::maybe_flag_fixed_fd(std::move(op), sockfd);
508 return detail::maybe_flag_fixed_fd(std::move(op), sockfd);
511#if !IO_URING_CHECK_VERSION(2, 7)
516inline auto async_send(Fd sockfd, BundledProvidedBufferQueue &buf,
int flags) {
518 sockfd,
nullptr, 0, flags);
519 return detail::maybe_flag_fixed_fd(std::move(op), sockfd);
526template <FdLike Fd, BufferLike Buffer>
528 const struct sockaddr *addr, socklen_t addrlen) {
530 buf.size(), flags, addr, addrlen);
531 return detail::maybe_flag_fixed_fd(std::move(op), sockfd);
539 const struct sockaddr *addr, socklen_t addrlen) {
541 nullptr, 0, flags, addr, addrlen);
542 return detail::maybe_flag_fixed_fd(std::move(op), sockfd);
545#if !IO_URING_CHECK_VERSION(2, 7)
550inline auto async_sendto(Fd sockfd, BundledProvidedBufferQueue &buf,
int flags,
551 const struct sockaddr *addr, socklen_t addrlen) {
553 &buf, detail::prep_sendto, sockfd,
nullptr, 0, flags, addr, addrlen);
554 return detail::maybe_flag_fixed_fd(std::move(op), sockfd);
561template <FdLike Fd,
typename Buffer,
typename FreeFunc>
562inline auto async_send_zc(Fd sockfd, Buffer &&buf,
int flags,
unsigned zc_flags,
565 std::forward<FreeFunc>(func), io_uring_prep_send_zc, sockfd, buf.data(),
566 buf.size(), flags, zc_flags);
567 return detail::maybe_flag_fixed_fd(std::move(op), sockfd);
573template <FdLike Fd, BufferLike Buffer,
typename FreeFunc>
574inline auto async_send_zc(Fd sockfd, detail::FixedBuffer<Buffer> buf,
int flags,
575 unsigned zc_flags, FreeFunc &&func) {
577 std::forward<FreeFunc>(func), io_uring_prep_send_zc_fixed, sockfd,
578 buf.value.data(), buf.value.size(), flags, zc_flags, buf.buf_index);
579 return detail::maybe_flag_fixed_fd(std::move(op), sockfd);
585template <FdLike Fd, BufferLike Buffer,
typename FreeFunc>
587 const struct sockaddr *addr, socklen_t addrlen,
588 unsigned zc_flags, FreeFunc &&func) {
590 std::forward<FreeFunc>(func), detail::prep_sendto_zc, sockfd,
591 buf.data(), buf.size(), flags, addr, addrlen, zc_flags);
592 return detail::maybe_flag_fixed_fd(std::move(op), sockfd);
598template <FdLike Fd, BufferLike Buffer,
typename FreeFunc>
600 int flags,
const struct sockaddr *addr,
601 socklen_t addrlen,
unsigned zc_flags,
604 std::forward<FreeFunc>(func), detail::prep_sendto_zc_fixed, sockfd,
605 buf.value.data(), buf.value.size(), flags, addr, addrlen, zc_flags,
607 return detail::maybe_flag_fixed_fd(std::move(op), sockfd);
613template <FdLike Fd, BufferLike Buffer>
617 return detail::maybe_flag_fixed_fd(std::move(op), sockfd);
623template <FdLike Fd, NotBundledBufferRing Buffer>
627 return detail::maybe_flag_fixed_fd(std::move(op), sockfd);
630#if !IO_URING_CHECK_VERSION(2, 7)
634template <FdLike Fd, BundledBufferRing Buffer>
637 sockfd,
nullptr, 0, flags);
638 return detail::maybe_flag_fixed_fd(std::move(op), sockfd);
645template <FdLike Fd, NotBundledBufferRing Buffer,
typename MultiShotFunc>
647 MultiShotFunc &&func) {
649 std::forward<MultiShotFunc>(func), &buf, io_uring_prep_recv_multishot,
650 sockfd,
nullptr, 0, flags);
651 return detail::maybe_flag_fixed_fd(std::move(op), sockfd);
654#if !IO_URING_CHECK_VERSION(2, 7)
658template <FdLike Fd, BundledBufferRing Buffer,
typename MultiShotFunc>
660 MultiShotFunc &&func) {
662 std::forward<MultiShotFunc>(func), &buf, io_uring_prep_recv_multishot,
663 sockfd,
nullptr, 0, flags);
664 return detail::maybe_flag_fixed_fd(std::move(op), sockfd);
679 struct open_how *how,
unsigned file_index) {
689 return detail::maybe_flag_fixed_fd(std::move(op), fd);
710 const char *newpath,
unsigned int flags) {
711 return make_op_awaiter(io_uring_prep_renameat, olddfd, oldpath, newdfd,
729 make_op_awaiter(io_uring_prep_sync_file_range, fd, len, offset, flags);
730 return detail::maybe_flag_fixed_fd(std::move(op), fd);
751 const char *linkpath) {
752 return make_op_awaiter(io_uring_prep_symlinkat, target, newdirfd, linkpath);
766 const char *newpath,
int flags) {
774inline auto async_link(
const char *oldpath,
const char *newpath,
int flags) {
775 return async_linkat(AT_FDCWD, oldpath, AT_FDCWD, newpath, flags);
783 return make_op_awaiter(io_uring_prep_getxattr, name, value, path, len);
790 const char *path,
int flags,
unsigned int len) {
791 return make_op_awaiter(io_uring_prep_setxattr, name, value, path, flags,
807 int flags,
unsigned int len) {
808 return make_op_awaiter(io_uring_prep_fsetxattr, fd, name, value, flags,
816 unsigned int flags) {
817 return make_op_awaiter(io_uring_prep_socket, domain, type, protocol, flags);
824 unsigned file_index,
unsigned int flags) {
825 return make_op_awaiter(io_uring_prep_socket_direct, domain, type, protocol,
829#if !IO_URING_CHECK_VERSION(2, 5)
835 void *optval,
int optlen) {
837 optname, optval, optlen);
838 return detail::maybe_flag_fixed_fd(std::move(op), fd);
842#if !IO_URING_CHECK_VERSION(2, 6)
847 int options,
unsigned int flags) {
848 return make_op_awaiter(io_uring_prep_waitid, idtype,
id, infop, options,
853#if !IO_URING_CHECK_VERSION(2, 6)
858 uint32_t futex_flags,
unsigned int flags) {
864#if !IO_URING_CHECK_VERSION(2, 6)
869 uint32_t futex_flags,
unsigned int flags) {
875#if !IO_URING_CHECK_VERSION(2, 6)
880 unsigned int flags) {
881 return make_op_awaiter(io_uring_prep_futex_waitv, futex, nr_futex, flags);
885#if !IO_URING_CHECK_VERSION(2, 6)
890 return make_op_awaiter(io_uring_prep_fixed_fd_install, fixed_fd, flags);
894#if !IO_URING_CHECK_VERSION(2, 4)
899 unsigned int flags) {
900 void *payload =
nullptr;
903 payload =
reinterpret_cast<void *
>((target_fd + 1) << 3);
906 io_uring_prep_msg_ring_fd, dst.ring_.ring_fd, source_fd, target_fd,
907 reinterpret_cast<uint64_t
>(encode_work(payload, WorkType::SendFd)),
912#if !IO_URING_CHECK_VERSION(2, 6)
918 return detail::maybe_flag_fixed_fd(std::move(op), fd);
922#if !IO_URING_CHECK_VERSION(2, 8)
928 auto op =
make_op_awaiter(io_uring_prep_cmd_discard, fd, offset, nbytes);
929 return detail::maybe_flag_fixed_fd(std::move(op), fd);
933#if !IO_URING_CHECK_VERSION(2, 7)
938inline auto async_bind(Fd fd,
struct sockaddr *addr, socklen_t addrlen) {
940 return detail::maybe_flag_fixed_fd(std::move(op), fd);
944#if !IO_URING_CHECK_VERSION(2, 7)
950 return detail::maybe_flag_fixed_fd(std::move(op), fd);
961#if !IO_URING_CHECK_VERSION(2, 10)
967 return make_op_awaiter(io_uring_prep_epoll_wait, fd, events, maxevents,
972#if !IO_URING_CHECK_VERSION(2, 12)
981#if !IO_URING_CHECK_VERSION(2, 12)
986 unsigned int file_index) {
Helper functions for composing asynchronous operations.
Provided buffer queue.
Definition provided_buffers.hpp:177
Helper functions for asynchronous operations.
#define CONDY_FILE_INDEX_ALLOC
Placeholder to let io_uring allocate a direct file descriptor.
Definition helpers.hpp:20
The main namespace for the Condy library.
Definition condy.hpp:28
auto async_read_multishot(Fd fd, Buffer &buf, __u64 offset, MultiShotFunc &&func)
See io_uring_prep_read_multishot.
Definition async_operations.hpp:373
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...
Definition awaiter_operations.hpp:66
auto async_symlinkat(const char *target, int newdirfd, const char *linkpath)
See io_uring_prep_symlinkat.
Definition async_operations.hpp:750
auto make_op_awaiter(Func &&func, Args &&...args)
This function creates a variant of OpAwaiter. OpAwaiter represents an asynchronous operation that can...
Definition awaiter_operations.hpp:23
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.
Definition async_operations.hpp:39
auto async_fsetxattr(int fd, const char *name, const char *value, int flags, unsigned int len)
See io_uring_prep_fsetxattr.
Definition async_operations.hpp:806
auto async_fadvise(Fd fd, __u64 offset, off_t len, int advice)
See io_uring_prep_fadvise.
Definition async_operations.hpp:415
auto async_writev(Fd fd, const struct iovec *iovecs, unsigned int nr_vecs, __u64 offset, int flags)
See io_uring_prep_writev2.
Definition async_operations.hpp:91
auto async_fixed_fd_install(int fixed_fd, unsigned int flags)
See io_uring_prep_fixed_fd_install.
Definition async_operations.hpp:889
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...
Definition awaiter_operations.hpp:87
auto async_socket_direct(int domain, int type, int protocol, unsigned file_index, unsigned int flags)
See io_uring_prep_socket_direct.
Definition async_operations.hpp:823
auto async_madvise64(void *addr, off_t length, int advice)
See io_uring_prep_madvise64.
Definition async_operations.hpp:442
auto async_fsync(Fd fd, unsigned fsync_flags)
See io_uring_prep_fsync.
Definition async_operations.hpp:169
auto async_ftruncate(Fd fd, loff_t len)
See io_uring_prep_ftruncate.
Definition async_operations.hpp:916
auto async_recvmsg(Fd fd, struct msghdr *msg, unsigned flags)
See io_uring_prep_recvmsg.
Definition async_operations.hpp:115
auto async_openat2(int dfd, const char *path, struct open_how *how)
See io_uring_prep_openat2.
Definition async_operations.hpp:671
auto async_open_direct(const char *path, int flags, mode_t mode, unsigned file_index)
See io_uring_prep_openat_direct.
Definition async_operations.hpp:319
auto async_write(Fd fd, Buffer &&buf, __u64 offset)
See io_uring_prep_write.
Definition async_operations.hpp:386
auto async_getxattr(const char *name, char *value, const char *path, unsigned int len)
See io_uring_prep_getxattr.
Definition async_operations.hpp:781
auto async_unlinkat(int dfd, const char *path, int flags)
See io_uring_prep_unlinkat.
Definition async_operations.hpp:695
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...
Definition awaiter_operations.hpp:35
auto async_openat_direct(int dfd, const char *path, int flags, mode_t mode, unsigned file_index)
See io_uring_prep_openat_direct.
Definition async_operations.hpp:303
auto async_epoll_ctl(int epfd, int fd, int op, struct epoll_event *ev)
See io_uring_prep_epoll_ctl.
Definition async_operations.hpp:957
auto async_mkdir(const char *path, mode_t mode)
See io_uring_prep_mkdirat.
Definition async_operations.hpp:743
auto async_fgetxattr(int fd, const char *name, char *value, unsigned int len)
See io_uring_prep_fgetxattr.
Definition async_operations.hpp:798
auto async_statx(int dfd, const char *path, int flags, unsigned mask, struct statx *statxbuf)
See io_uring_prep_statx.
Definition async_operations.hpp:405
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.
Definition async_operations.hpp:586
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...
Definition awaiter_operations.hpp:129
auto async_cmd_discard(Fd fd, uint64_t offset, uint64_t nbytes)
See io_uring_prep_cmd_discard.
Definition async_operations.hpp:927
auto async_link(const char *oldpath, const char *newpath, int flags)
See io_uring_prep_linkat.
Definition async_operations.hpp:774
auto async_multishot_accept_direct(Fd fd, struct sockaddr *addr, socklen_t *addrlen, int flags, MultiShotFunc &&func)
See io_uring_prep_multishot_accept_direct.
Definition async_operations.hpp:241
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.
Definition async_operations.hpp:527
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.
Definition async_operations.hpp:857
auto async_recv_multishot(Fd sockfd, Buffer &buf, int flags, MultiShotFunc &&func)
See io_uring_prep_recv_multishot.
Definition async_operations.hpp:646
auto async_recv(Fd sockfd, Buffer &&buf, int flags)
See io_uring_prep_recv.
Definition async_operations.hpp:614
auto async_multishot_accept(Fd fd, struct sockaddr *addr, socklen_t *addrlen, int flags, MultiShotFunc &&func)
See io_uring_prep_multishot_accept.
Definition async_operations.hpp:228
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...
Definition awaiter_operations.hpp:49
auto async_fallocate(Fd fd, int mode, __u64 offset, __u64 len)
See io_uring_prep_fallocate.
Definition async_operations.hpp:288
auto async_madvise(void *addr, __u32 length, int advice)
See io_uring_prep_madvise.
Definition async_operations.hpp:434
auto async_epoll_wait(int fd, struct epoll_event *events, int maxevents, unsigned flags)
See io_uring_prep_epoll_wait.
Definition async_operations.hpp:965
auto async_symlink(const char *target, const char *linkpath)
See io_uring_prep_symlinkat.
Definition async_operations.hpp:758
auto async_sync_file_range(Fd fd, unsigned len, __u64 offset, int flags)
See io_uring_prep_sync_file_range.
Definition async_operations.hpp:726
auto async_fadvise64(Fd fd, __u64 offset, off_t len, int advice)
See io_uring_prep_fadvise64.
Definition async_operations.hpp:425
auto async_bind(Fd fd, struct sockaddr *addr, socklen_t addrlen)
See io_uring_prep_bind.
Definition async_operations.hpp:938
auto async_connect(Fd fd, const struct sockaddr *addr, socklen_t addrlen)
See io_uring_prep_connect.
Definition async_operations.hpp:271
auto async_waitid(idtype_t idtype, id_t id, siginfo_t *infop, int options, unsigned int flags)
See io_uring_prep_waitid.
Definition async_operations.hpp:846
auto async_files_update(int *fds, unsigned nr_fds, int offset)
See io_uring_prep_files_update.
Definition async_operations.hpp:280
auto async_cmd_sock(int cmd_op, Fd fd, int level, int optname, void *optval, int optlen)
See io_uring_prep_cmd_sock.
Definition async_operations.hpp:834
auto async_tee(Fd1 fd_in, Fd2 fd_out, unsigned int nbytes, unsigned int splice_flags)
See io_uring_prep_tee.
Definition async_operations.hpp:53
auto async_recvmsg_multishot(Fd fd, struct msghdr *msg, unsigned flags, Buffer &buf, MultiShotFunc &&func)
See io_uring_prep_recvmsg_multishot.
Definition async_operations.hpp:124
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.
Definition async_operations.hpp:868
auto async_sendmsg(Fd fd, const struct msghdr *msg, unsigned flags)
See io_uring_prep_sendmsg.
Definition async_operations.hpp:136
auto async_read(Fd fd, Buffer &&buf, __u64 offset)
See io_uring_prep_read.
Definition async_operations.hpp:342
auto async_cancel_fd(Fd fd, unsigned int flags)
See io_uring_prep_cancel_fd.
Definition async_operations.hpp:253
auto async_pipe_direct(int *fds, int pipe_flags, unsigned int file_index)
See io_uring_prep_pipe_direct.
Definition async_operations.hpp:985
auto async_link_timeout(struct __kernel_timespec *ts, unsigned flags)
See io_uring_prep_link_timeout.
Definition async_operations.hpp:263
auto async_nop()
See io_uring_prep_nop.
Definition async_operations.hpp:177
auto async_sendmsg_zc(Fd fd, const struct msghdr *msg, unsigned flags, FreeFunc &&func)
See io_uring_prep_sendmsg_zc.
Definition async_operations.hpp:145
auto async_close(int fd)
See io_uring_prep_close.
Definition async_operations.hpp:327
auto async_open(const char *path, int flags, mode_t mode)
See io_uring_prep_openat.
Definition async_operations.hpp:312
auto flag(Awaiter &&awaiter)
Decorates an awaiter with specific io_uring sqe flags.
Definition awaiter_operations.hpp:146
auto async_listen(Fd fd, int backlog)
See io_uring_prep_listen.
Definition async_operations.hpp:948
auto async_send(Fd sockfd, Buffer &&buf, int flags)
See io_uring_prep_send.
Definition async_operations.hpp:495
auto async_renameat(int olddfd, const char *oldpath, int newdfd, const char *newpath, unsigned int flags)
See io_uring_prep_renameat.
Definition async_operations.hpp:709
auto async_accept_direct(Fd fd, struct sockaddr *addr, socklen_t *addrlen, int flags, unsigned int file_index)
See io_uring_prep_accept_direct.
Definition async_operations.hpp:216
auto async_timeout(struct __kernel_timespec *ts, unsigned count, unsigned flags)
See io_uring_prep_timeout.
Definition async_operations.hpp:182
auto async_rename(const char *oldpath, const char *newpath)
See io_uring_prep_renameat.
Definition async_operations.hpp:718
auto async_setxattr(const char *name, const char *value, const char *path, int flags, unsigned int len)
See io_uring_prep_setxattr.
Definition async_operations.hpp:789
auto async_send_zc(Fd sockfd, Buffer &&buf, int flags, unsigned zc_flags, FreeFunc &&func)
See io_uring_prep_send_zc.
Definition async_operations.hpp:562
auto async_openat2_direct(int dfd, const char *path, struct open_how *how, unsigned file_index)
See io_uring_prep_openat2_direct.
Definition async_operations.hpp:678
auto async_unlink(const char *path, int flags)
See io_uring_prep_unlinkat.
Definition async_operations.hpp:702
auto async_accept(Fd fd, struct sockaddr *addr, socklen_t *addrlen, int flags)
See io_uring_prep_accept.
Definition async_operations.hpp:206
auto async_mkdirat(int dfd, const char *path, mode_t mode)
See io_uring_prep_mkdirat.
Definition async_operations.hpp:736
auto async_readv(Fd fd, const struct iovec *iovecs, unsigned nr_vecs, __u64 offset, int flags)
See io_uring_prep_readv2.
Definition async_operations.hpp:67
auto async_openat(int dfd, const char *path, int flags, mode_t mode)
See io_uring_prep_openat.
Definition async_operations.hpp:296
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...
Definition awaiter_operations.hpp:108
auto async_timeout_multishot(struct __kernel_timespec *ts, unsigned count, unsigned flags, MultiShotFunc &&func)
See io_uring_prep_timeout.
Definition async_operations.hpp:193
auto async_linkat(int olddfd, const char *oldpath, int newdfd, const char *newpath, int flags)
See io_uring_prep_linkat.
Definition async_operations.hpp:765
auto async_pipe(int *fds, int pipe_flags)
See io_uring_prep_pipe.
Definition async_operations.hpp:976
auto async_fixed_fd_send(FdTable &dst, int source_fd, int target_fd, unsigned int flags)
See io_uring_prep_msg_ring_fd.
Definition async_operations.hpp:898
auto async_futex_waitv(struct futex_waitv *futex, uint32_t nr_futex, unsigned int flags)
See io_uring_prep_futex_waitv.
Definition async_operations.hpp:879
auto async_shutdown(Fd fd, int how)
See io_uring_prep_shutdown.
Definition async_operations.hpp:687
auto async_socket(int domain, int type, int protocol, unsigned int flags)
See io_uring_prep_socket.
Definition async_operations.hpp:815
Support for io_uring provided buffers.