io-uring
io-uring copied to clipboard
opcode: offset should be u64 instead of libc::off_t
libc::off_t
is i64
while kernel and liburing uses an u64
for the offset field in most of the opcodes.
There are some exceptions like IORING_OP_FILES_UPDATE
and IORING_OP_FALLOCATE
.
To avoid differences and casting issues (e.g. using try_into()
on u64 to cast to i64 can fail) we should follow what liburing does and expose offset
as u64.
And POSIX seems to confirm that off_t
shall be signed:
blkcnt_t and off_t shall be signed integer types.
https://pubs.opengroup.org/onlinepubs/009696899/basedefs/sys/types.h.html
Under the impression that the kernel will always convert it to loff_t
, but I agree that we should follow liburing's interface.
Anyway this is a break change and we need to keep it until the next version.
Under the impression that the kernel will always convert it to
loff_t
, but I agree that we should follow liburing's interface.
Right, actually then it always gets converted to loff_t
which is signed, mah
Anyway this is a break change and we need to keep it until the next version.
It's fine, please let me know when I should rebase the PR.