summaryrefslogtreecommitdiff
path: root/src/register.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2019-06-17 11:32:37 -0600
committerJens Axboe <axboe@kernel.dk>2019-06-17 11:34:22 -0600
commita8d4237e364b2a9973dabff35a6c0133572a3357 (patch)
treeab96eef14c9e2faf3369ce37950439c986578b32 /src/register.c
parent9d9e3b87214ab7e70e7174299890c30ea3b24e28 (diff)
downloadliburing-a8d4237e364b2a9973dabff35a6c0133572a3357.tar.gz
liburing-a8d4237e364b2a9973dabff35a6c0133572a3357.tar.bz2
Add support for eventfd registration
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'src/register.c')
-rw-r--r--src/register.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/register.c b/src/register.c
index b993fa9..7561575 100644
--- a/src/register.c
+++ b/src/register.c
@@ -58,3 +58,27 @@ int io_uring_unregister_files(struct io_uring *ring)
return 0;
}
+
+int io_uring_register_eventfd(struct io_uring *ring, int event_fd)
+{
+ int ret;
+
+ ret = io_uring_register(ring->ring_fd, IORING_REGISTER_EVENTFD,
+ &event_fd, 1);
+ if (ret < 0)
+ return -errno;
+
+ return 0;
+}
+
+int io_uring_unregister_eventfd(struct io_uring *ring)
+{
+ int ret;
+
+ ret = io_uring_register(ring->ring_fd, IORING_UNREGISTER_EVENTFD, NULL,
+ 0);
+ if (ret < 0)
+ return -errno;
+
+ return 0;
+}