From 9d9e3b87214ab7e70e7174299890c30ea3b24e28 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Mon, 17 Jun 2019 11:27:48 -0600 Subject: Make io_uring registration arguments const We don't modify them, make that clear. Signed-off-by: Jens Axboe --- src/liburing.h | 7 ++++--- src/register.c | 4 ++-- src/syscall.c | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/liburing.h b/src/liburing.h index 1b4884a..ca854b6 100644 --- a/src/liburing.h +++ b/src/liburing.h @@ -58,7 +58,7 @@ struct io_uring { extern int io_uring_setup(unsigned entries, struct io_uring_params *p); extern int io_uring_enter(unsigned fd, unsigned to_submit, unsigned min_complete, unsigned flags, sigset_t *sig); -extern int io_uring_register(int fd, unsigned int opcode, void *arg, +extern int io_uring_register(int fd, unsigned int opcode, const void *arg, unsigned int nr_args); /* @@ -77,10 +77,11 @@ extern int io_uring_submit(struct io_uring *ring); extern int io_uring_submit_and_wait(struct io_uring *ring, unsigned wait_nr); extern struct io_uring_sqe *io_uring_get_sqe(struct io_uring *ring); -extern int io_uring_register_buffers(struct io_uring *ring, struct iovec *iovecs, +extern int io_uring_register_buffers(struct io_uring *ring, + const struct iovec *iovecs, unsigned nr_iovecs); extern int io_uring_unregister_buffers(struct io_uring *ring); -extern int io_uring_register_files(struct io_uring *ring, __s32 *files, +extern int io_uring_register_files(struct io_uring *ring, const int *files, unsigned nr_files); extern int io_uring_unregister_files(struct io_uring *ring); diff --git a/src/register.c b/src/register.c index e352291..b993fa9 100644 --- a/src/register.c +++ b/src/register.c @@ -9,7 +9,7 @@ #include "io_uring.h" #include "liburing.h" -int io_uring_register_buffers(struct io_uring *ring, struct iovec *iovecs, +int io_uring_register_buffers(struct io_uring *ring, const struct iovec *iovecs, unsigned nr_iovecs) { int ret; @@ -34,7 +34,7 @@ int io_uring_unregister_buffers(struct io_uring *ring) return 0; } -int io_uring_register_files(struct io_uring *ring, __s32 *files, +int io_uring_register_files(struct io_uring *ring, const int *files, unsigned nr_files) { int ret; diff --git a/src/syscall.c b/src/syscall.c index 2904153..d0c58cf 100644 --- a/src/syscall.c +++ b/src/syscall.c @@ -34,7 +34,7 @@ # endif #endif -int io_uring_register(int fd, unsigned int opcode, void *arg, +int io_uring_register(int fd, unsigned int opcode, const void *arg, unsigned int nr_args) { return syscall(__NR_io_uring_register, fd, opcode, arg, nr_args); -- cgit