Skip to contentSkip to conversation

io_uring_enter(2): clarify OP_READ and OP_WRITE

PATCH Superseded Drew DeVault 2 participants 3 messages May 23, 2021 io_uring

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 io_uring_enter(2): clarify OP_READ and OP_WRITE

These do not advance the internal file offset, making them behave more like pread/pwrite than read/write.

---
 man/io_uring_enter.2 | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
man/io_uring_enter.2 +6 -4
index f898ffd..81044c1 100644
@@ -576,16 +576,18 @@ for the general description of the related system call. Available since 5.6.
 .TP
 .B IORING_OP_WRITE
 Issue the equivalent of a
-.BR read(2)
+.BR pread(2)
 or
-.BR write(2)
+.BR pwrite(2)
 system call.
 .I fd
 is the file descriptor to be operated on,
 .I addr
-contains the buffer in question, and
+contains the buffer in question,
 .I len
-contains the length of the IO operation. These are non-vectored versions of the
+contains the length of the IO operation, and
+.I offs
+contains the read or write offset. These are non-vectored versions of the
 .B IORING_OP_READV
 and
 .B IORING_OP_WRITEV
Signature · 1 line
2.31.1
maintainer
#1 lore raw
Quoted 2 lines · Drew DeVault

These do not advance the internal file offset, making them behave more like pread/pwrite than read/write.

They do, if -1 is used as the offset. Care to update the patch and include that clarification?

Signature · 1 line
Jens Axboe
#2 lore raw
Quoted 2 lines · Jens Axboe

They do, if -1 is used as the offset. Care to update the patch and include that clarification?

Certainly.