From: Alois Wohlschlager <alois1@gmx-topmail.de>
To: io-uring@vger.kernel.org
Subject: [PATCH] io_uring_enter(2): Clarify how to read from and write to non-seekable files
Date: Mon, 31 May 2021 14:38:15 +0200 [thread overview]
Message-ID: <2191760.Ec4jsOL7QN@genesis> (raw)
IORING_OP_READ* and IORING_OP_WRITE* all take a file offset. These
operations can still be used with non-seekable files, as long as the
offset is set to zero.
Signed-off-by: Alois Wohlschlager <alois1@gmx-topmail.de>
---
man/io_uring_enter.2 | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/man/io_uring_enter.2 b/man/io_uring_enter.2
index 5b498e5..dd3c962 100644
--- a/man/io_uring_enter.2
+++ b/man/io_uring_enter.2
@@ -195,6 +195,9 @@ Vectored read and write operations, similar to
.BR preadv2 (2)
and
.BR pwritev2 (2).
+If the file is not seekable,
+.I off
+must be set to zero.
.TP
.B IORING_OP_READ_FIXED
@@ -588,6 +591,10 @@ contains the buffer in question,
contains the length of the IO operation, and
.I offs
contains the read or write offset. If
+.I fd
+does not refer to a seekable file,
+.I off
+must be set to zero. If
.I offs
is set to -1, the offset will use (and advance) the file position, like the
.BR read(2)
--
2.31.1
next reply other threads:[~2021-05-31 12:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-31 12:38 Alois Wohlschlager [this message]
2021-06-01 17:10 ` [PATCH] io_uring_enter(2): Clarify how to read from and write to non-seekable files Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2191760.Ec4jsOL7QN@genesis \
--to=alois1@gmx-topmail.de \
--cc=io-uring@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.