diff options
author | Jens Axboe <axboe@kernel.dk> | 2019-10-17 16:54:28 -0600 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-10-17 16:54:28 -0600 |
commit | e8b0100c17eec78766498f9bed273988b76dc215 (patch) | |
tree | db3fc5e917270c8c504d673e6bcd9def9d148c40 | |
parent | b8712db0fa026e0892e66435e6ff7bb286f21587 (diff) | |
download | liburing-e8b0100c17eec78766498f9bed273988b76dc215.tar.gz liburing-e8b0100c17eec78766498f9bed273988b76dc215.tar.bz2 |
Add io_uring_prep_accept() helper
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r-- | src/include/liburing.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/include/liburing.h b/src/include/liburing.h index d7a2bc2..4e89a8a 100644 --- a/src/include/liburing.h +++ b/src/include/liburing.h @@ -270,6 +270,14 @@ static inline void io_uring_prep_timeout_remove(struct io_uring_sqe *sqe, sqe->timeout_flags = flags; } +static inline void io_uring_prep_accept(struct io_uring_sqe *sqe, int fd, + struct sockaddr *addr, + socklen_t *addrlen, int flags) +{ + io_uring_prep_rw(IORING_OP_ACCEPT, sqe, fd, addr, 0, (__u64) addrlen); + sqe->accept_flags = flags; +} + static inline unsigned io_uring_sq_space_left(struct io_uring *ring) { return *ring->sq.kring_entries - (ring->sq.sqe_tail - ring->sq.sqe_head); |