2 Commits

Author SHA1 Message Date
Ian Gulliver
38eabdd644 Match const signatures in io_uring_prep_* to native functions
io_uring_prep_{readv,writev,read_fixed,write_fixed}() take
non-const arguments that are const in the native functions
that they mimic. Make those arguments const.

Signed-off-by: Ian Gulliver <git@flamingcow.io>
2019-05-19 10:21:01 -07:00
Jens Axboe
4e41621717 Merge branch 'missing-header' of https://github.com/flamingcow66/liburing
* 'missing-header' of https://github.com/flamingcow66/liburing:
  Fix liburing.h memset() missing declaration
2019-05-18 16:47:01 -06:00

View File

@@ -106,7 +106,8 @@ static inline void *io_uring_cqe_get_data(struct io_uring_cqe *cqe)
}
static inline void io_uring_prep_rw(int op, struct io_uring_sqe *sqe, int fd,
void *addr, unsigned len, off_t offset)
const void *addr, unsigned len,
off_t offset)
{
memset(sqe, 0, sizeof(*sqe));
sqe->opcode = op;
@@ -117,8 +118,8 @@ static inline void io_uring_prep_rw(int op, struct io_uring_sqe *sqe, int fd,
}
static inline void io_uring_prep_readv(struct io_uring_sqe *sqe, int fd,
struct iovec *iovecs, unsigned nr_vecs,
off_t offset)
const struct iovec *iovecs,
unsigned nr_vecs, off_t offset)
{
io_uring_prep_rw(IORING_OP_READV, sqe, fd, iovecs, nr_vecs, offset);
}
@@ -131,14 +132,14 @@ static inline void io_uring_prep_read_fixed(struct io_uring_sqe *sqe, int fd,
}
static inline void io_uring_prep_writev(struct io_uring_sqe *sqe, int fd,
struct iovec *iovecs, unsigned nr_vecs,
off_t offset)
const struct iovec *iovecs,
unsigned nr_vecs, off_t offset)
{
io_uring_prep_rw(IORING_OP_WRITEV, sqe, fd, iovecs, nr_vecs, offset);
}
static inline void io_uring_prep_write_fixed(struct io_uring_sqe *sqe, int fd,
void *buf, unsigned nbytes,
const void *buf, unsigned nbytes,
off_t offset)
{
io_uring_prep_rw(IORING_OP_WRITE_FIXED, sqe, fd, buf, nbytes, offset);