diff --git a/emper/io/Future.hpp b/emper/io/Future.hpp index 04999b92be6abebf1f690169c03679f21229e036..efffd8e4369f2337b46e858e9eadec941b9420f8 100644 --- a/emper/io/Future.hpp +++ b/emper/io/Future.hpp @@ -654,7 +654,11 @@ class CancelWrapper : public Future { * @brief Request a madvise operation */ class MadviseFuture : public Future { - void prepareSqe(io_uring_sqe* sqe) override { io_uring_prep_madvise(sqe, buf, len, flags); } + void prepareSqe(io_uring_sqe* sqe) override { + // TODO: Check that len is within the bounds of off_t. + auto len_off_t = static_cast<off_t>(len); + io_uring_prep_madvise(sqe, buf, len_off_t, flags); + } public: MadviseFuture(void* addr, size_t len, int advise)