commit 3ab74eae7ce96e14e13695da7b957b116d9fcdb6
parent d7574e17164d577891661c521cf26fafe240d620
Author: Bor Grošelj Simić <bgs@turminal.net>
Date: Wed, 27 Apr 2022 14:45:48 +0200
readv,writev: don't treat underread/write as error in docs
from readv(2) on linux:
"Note that it is not an error for a successful call to transfer fewer
bytes than requested"
I could also not find any reference to freebsd handling vectored io
differently than regular io in this regard.
Signed-off-by: Bor Grošelj Simić <bgs@turminal.net>
Diffstat:
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/io/+freebsd/vector.ha b/io/+freebsd/vector.ha
@@ -13,7 +13,7 @@ export fn mkvector(buf: []u8) vector = vector {
// Performs a vectored read on the given file. A read is performed on each of
// the vectors, prepared with [[mkvector]], in order, and the total number of
-// bytes read is returned. Note that an under-read is considered an error.
+// bytes read is returned.
export fn readv(fd: file, vectors: vector...) (size | EOF | error) = {
match (rt::readv(fd, vectors: *[*]rt::iovec, len(vectors): int)) {
case let err: rt::errno =>
@@ -30,7 +30,7 @@ export fn readv(fd: file, vectors: vector...) (size | EOF | error) = {
// Performs a vectored write on the given file. Each of the vectors, prepared
// with [[mkvector]], are written to the file in order, and the total number of
-// bytes written is returned. Note that an under-write is considered an error.
+// bytes written is returned.
export fn writev(fd: file, vectors: vector...) (size | error) = {
match (rt::writev(fd, vectors: *[*]rt::iovec, len(vectors): int)) {
case let err: rt::errno =>
diff --git a/io/+linux/vector.ha b/io/+linux/vector.ha
@@ -13,7 +13,7 @@ export fn mkvector(buf: []u8) vector = vector {
// Performs a vectored read on the given file. A read is performed on each of
// the vectors, prepared with [[mkvector]], in order, and the total number of
-// bytes read is returned. Note that an under-read is considered an error.
+// bytes read is returned.
export fn readv(fd: file, vectors: vector...) (size | EOF | error) = {
match (rt::readv(fd, vectors: *[*]rt::iovec, len(vectors): int)) {
case let err: rt::errno =>
@@ -30,7 +30,7 @@ export fn readv(fd: file, vectors: vector...) (size | EOF | error) = {
// Performs a vectored write on the given file. Each of the vectors, prepared
// with [[mkvector]], are written to the file in order, and the total number of
-// bytes written is returned. Note that an under-write is considered an error.
+// bytes written is returned.
export fn writev(fd: file, vectors: vector...) (size | error) = {
match (rt::writev(fd, vectors: *[*]rt::iovec, len(vectors): int)) {
case let err: rt::errno =>