liburing
liburing copied to clipboard
-1 offset and non-seekable files
The io_uring_enter manual states that for IORING_OP_WRITEV
If the file is not seekable, off must be set to zero.
and for IORING_OP_WRITE
If fd does not refer to a seekable file, off must be set to zero. If offs is set to -1 , the offset will use (and advance) the file position, like the read(2) and write(2) system calls.
A strict reading seems to imply that off == -1 is illegal for a non-seekable file, but it seems to work in practice and generally seems useful if, for example, you are trying to read from an arbitrary file which may or may not be seekable.
What's the intended behavior? Thanks!
Also meant to ask, IORING_OP_WRITEV seems to support a -1 offset but doesn't mention it. Is that OK to rely on?
Any thoughts? Thanks