summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/io_uring.c11
-rw-r--r--src/liburing.h4
2 files changed, 9 insertions, 6 deletions
diff --git a/src/io_uring.c b/src/io_uring.c
index bf79b9f..a75d135 100644
--- a/src/io_uring.c
+++ b/src/io_uring.c
@@ -188,17 +188,20 @@ err:
* Returns -1 on error, or zero on success. On success, 'ring'
* contains the necessary information to read/write to the rings.
*/
-int io_uring_queue_init(unsigned entries, struct io_uring_params *p,
- struct io_uring *ring)
+int io_uring_queue_init(unsigned entries, struct io_uring *ring, unsigned flags)
{
+ struct io_uring_params p;
int fd, ret;
- fd = io_uring_setup(entries, p);
+ memset(&p, 0, sizeof(p));
+ p.flags = flags;
+
+ fd = io_uring_setup(entries, &p);
if (fd < 0)
return fd;
memset(ring, 0, sizeof(*ring));
- ret = io_uring_mmap(fd, p, &ring->sq, &ring->cq);
+ ret = io_uring_mmap(fd, &p, &ring->sq, &ring->cq);
if (!ret)
ring->ring_fd = fd;
return ret;
diff --git a/src/liburing.h b/src/liburing.h
index 4123ba1..fb07583 100644
--- a/src/liburing.h
+++ b/src/liburing.h
@@ -51,8 +51,8 @@ extern int io_uring_register(int fd, unsigned int opcode, void *arg);
/*
* Library interface
*/
-extern int io_uring_queue_init(unsigned entries, struct io_uring_params *p,
- struct io_uring *ring);
+extern int io_uring_queue_init(unsigned entries, struct io_uring *ring,
+ unsigned flags);
extern void io_uring_queue_exit(struct io_uring *ring);
extern int io_uring_get_completion(struct io_uring *ring,
struct io_uring_cqe **cqe_ptr);