This behaves like preadv2/pwritev2 with offset == -1, it'll use (and update) the current file position. This obviously comes with the caveat that if the application has multiple read/writes in flight, then the end result will not be as expected. This is similar to threads sharing a file descriptor and doing IO using the current file position. Since this feature isn't easily detectable by doing a read or write, add a feature flags, IORING_FEAT_RW_CUR_POS, to allow applications to detect presence of this feature.
Showing the changes to include/uapi/linux (1 of 2 files). Show all
Unified · Split
| @@ -174,6 +174,7 @@ struct io_uring_params { · 173 unmodified lines | |||
| 174 | #define IORING_FEAT_SINGLE_MMAP (1U << 0) | 174 | #define IORING_FEAT_SINGLE_MMAP (1U << 0) |
| 175 | #define IORING_FEAT_NODROP (1U << 1) | 175 | #define IORING_FEAT_NODROP (1U << 1) |
| 176 | #define IORING_FEAT_SUBMIT_STABLE (1U << 2) | 176 | #define IORING_FEAT_SUBMIT_STABLE (1U << 2) |
| 177 | #define IORING_FEAT_RW_CUR_POS (1U << 3) | ||
| 177 | 178 | ||
| 178 | /* | 179 | /* |
| 179 | * io_uring_register(2) opcodes and arguments | 180 | * io_uring_register(2) opcodes and arguments |