-
Notifications
You must be signed in to change notification settings - Fork 0
add async_uring_cmd #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -833,6 +833,22 @@ inline auto async_socket_direct(int domain, int type, int protocol, | |
| file_index, flags); | ||
| } | ||
|
|
||
| #if !IO_URING_CHECK_VERSION(2, 13) // >= 2.13 | ||
| /** | ||
| * @brief See io_uring_prep_uring_cmd | ||
| */ | ||
| template <FdLike Fd, typename CmdFunc> | ||
| inline auto async_uring_cmd(int cmd_op, Fd fd, CmdFunc &&cmd_func) { | ||
| auto prep_func = [cmd_op, fd, cmd_func = std::forward<CmdFunc>(cmd_func)]( | ||
| io_uring_sqe *sqe) { | ||
| io_uring_prep_uring_cmd(sqe, cmd_op, fd); | ||
| cmd_func(sqe); | ||
| }; | ||
| auto op = make_op_awaiter(std::move(prep_func)); | ||
| return detail::maybe_flag_fixed_fd(std::move(op), fd); | ||
|
Comment on lines
+841
to
+848
|
||
| } | ||
| #endif | ||
|
|
||
| #if !IO_URING_CHECK_VERSION(2, 5) // >= 2.5 | ||
| /** | ||
| * @brief See io_uring_prep_cmd_sock | ||
|
|
@@ -846,6 +862,19 @@ inline auto async_cmd_sock(int cmd_op, Fd fd, int level, int optname, | |
| } | ||
| #endif | ||
|
|
||
| #if !IO_URING_CHECK_VERSION(2, 13) // >= 2.13 | ||
|
wokron marked this conversation as resolved.
|
||
| /** | ||
| * @brief See io_uring_prep_cmd_getsockname | ||
| */ | ||
| template <FdLike Fd> | ||
| inline auto async_cmd_getsockname(Fd fd, struct sockaddr *sockaddr, | ||
| socklen_t *sockaddr_len, int peer) { | ||
| auto op = make_op_awaiter(io_uring_prep_cmd_getsockname, fd, sockaddr, | ||
| sockaddr_len, peer); | ||
| return detail::maybe_flag_fixed_fd(std::move(op), fd); | ||
| } | ||
| #endif | ||
|
|
||
| #if !IO_URING_CHECK_VERSION(2, 6) // >= 2.6 | ||
| /** | ||
| * @brief See io_uring_prep_waitid | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.