summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2020-01-23 20:15:37 -0700
committerJens Axboe <axboe@kernel.dk>2020-01-23 20:15:37 -0700
commitec0ce01687421557736b3b7a05d002ea122fc86f (patch)
tree74e1e1821afba5862d4f180bf038f2b8338e72fd
parent3825bdbc58f348ed09b393e3e20b7c109f3a8d95 (diff)
downloadliburing-ec0ce01687421557736b3b7a05d002ea122fc86f.tar.gz
liburing-ec0ce01687421557736b3b7a05d002ea122fc86f.tar.bz2
Add io_uring_register_probe()
Helper to return a struct of supported op codes. Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--src/include/liburing.h2
-rw-r--r--src/liburing.map1
-rw-r--r--src/register.c7
3 files changed, 7 insertions, 3 deletions
diff --git a/src/include/liburing.h b/src/include/liburing.h
index 70b0413..b0909b2 100644
--- a/src/include/liburing.h
+++ b/src/include/liburing.h
@@ -102,6 +102,8 @@ 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_unregister_eventfd(struct io_uring *ring);
+extern int io_uring_register_probe(struct io_uring *ring,
+ struct io_uring_probe *p, unsigned nr);
/*
* Helper for the peek/wait single cqe functions. Exported because of that,
diff --git a/src/liburing.map b/src/liburing.map
index e29db68..0c17c1f 100644
--- a/src/liburing.map
+++ b/src/liburing.map
@@ -69,4 +69,5 @@ LIBURING_0.3 {
LIBURING_0.4 {
global:
io_uring_ring_dontfork;
+ io_uring_register_probe;
} LIBURING_0.3;
diff --git a/src/register.c b/src/register.c
index a275b51..73daaf8 100644
--- a/src/register.c
+++ b/src/register.c
@@ -98,12 +98,13 @@ int io_uring_register_eventfd(struct io_uring *ring, int event_fd)
return 0;
}
-int io_uring_unregister_eventfd(struct io_uring *ring)
+int io_uring_register_probe(struct io_uring *ring, struct io_uring_probe *p,
+ unsigned int nr_ops)
{
int ret;
- ret = __sys_io_uring_register(ring->ring_fd, IORING_UNREGISTER_EVENTFD,
- NULL, 0);
+ ret = __sys_io_uring_register(ring->ring_fd, IORING_REGISTER_PROBE,
+ p, nr_ops);
if (ret < 0)
return -errno;