summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2020-04-12 09:52:37 -0600
committerJens Axboe <axboe@kernel.dk>2020-04-12 09:52:37 -0600
commitccc9a54156c44b22ce20edae79b6faf179cbbb9d (patch)
tree1bc564afae0bfd18117f7151b05fa26a188776ba
parent71d4e9ef41c093757a5148612150d96824996d86 (diff)
parent388ccdfc1b03f7f319f04867b6636df0985a7eb6 (diff)
downloadliburing-ccc9a54156c44b22ce20edae79b6faf179cbbb9d.tar.gz
liburing-ccc9a54156c44b22ce20edae79b6faf179cbbb9d.tar.bz2
Merge branch 'master' of https://github.com/markpapadakis/liburing
* 'master' of https://github.com/markpapadakis/liburing: Utility function io_uring_register_eventfd_async
-rw-r--r--src/include/liburing.h1
-rw-r--r--src/liburing.map2
-rw-r--r--src/register.c12
3 files changed, 15 insertions, 0 deletions
diff --git a/src/include/liburing.h b/src/include/liburing.h
index eaeda86..d2a16f6 100644
--- a/src/include/liburing.h
+++ b/src/include/liburing.h
@@ -102,6 +102,7 @@ extern int io_uring_unregister_files(struct io_uring *ring);
extern int io_uring_register_files_update(struct io_uring *ring, unsigned off,
int *files, unsigned nr_files);
extern int io_uring_register_eventfd(struct io_uring *ring, int fd);
+extern int io_uring_register_eventfd_async(struct io_uring *ring, int fd);
extern int io_uring_unregister_eventfd(struct io_uring *ring);
extern int io_uring_register_probe(struct io_uring *ring,
struct io_uring_probe *p, unsigned nr);
diff --git a/src/liburing.map b/src/liburing.map
index 055058f..8281f3d 100644
--- a/src/liburing.map
+++ b/src/liburing.map
@@ -51,4 +51,6 @@ LIBURING_0.5 {
} LIBURING_0.4;
LIBURING_0.6 {
+ global:
+ io_uring_register_eventfd_async;
} LIBURING_0.5;
diff --git a/src/register.c b/src/register.c
index f50473b..327a8ce 100644
--- a/src/register.c
+++ b/src/register.c
@@ -111,6 +111,18 @@ int io_uring_unregister_eventfd(struct io_uring *ring)
return 0;
}
+int io_uring_register_eventfd_async(struct io_uring *ring, int event_fd)
+{
+ int ret;
+
+ ret = __sys_io_uring_register(ring->ring_fd, IORING_REGISTER_EVENTFD_ASYNC,
+ &event_fd, 1);
+ if (ret < 0)
+ return -errno;
+
+ return 0;
+}
+
int io_uring_register_probe(struct io_uring *ring, struct io_uring_probe *p,
unsigned int nr_ops)
{