From 42729f477684b12735b572a4975d32fb1002a530 Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Sat, 26 Apr 2025 23:30:31 -0600 Subject: libhw_generic: io.h: Clarify that sum lenghts of iovecs must not be 0 --- libhw_generic/include/libhw/generic/io.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libhw_generic/include/libhw/generic/io.h') diff --git a/libhw_generic/include/libhw/generic/io.h b/libhw_generic/include/libhw/generic/io.h index 6adce8c..96680bb 100644 --- a/libhw_generic/include/libhw/generic/io.h +++ b/libhw_generic/include/libhw/generic/io.h @@ -58,6 +58,8 @@ void io_slice_wr_to_duplex(struct duplex_iovec *dst, const struct iovec *src, in /** * Return bytes-read on success, 0 on EOF, -errno on error; a short * read is *not* an error. + * + * It is invalid to call readv when the sum length of iovecs is 0. */ #define io_reader_LO_IFACE \ LO_FUNC(ssize_t, readv, const struct iovec *iov, int iovcnt) @@ -71,6 +73,8 @@ LO_INTERFACE(io_reader); * * Writes are *not* guaranteed to be atomic, so if you have concurrent * writers then you should arrange for a mutex to protect the writer. + * + * It is invalid to call writev when the sum length of iovecs is 0. */ #define io_writer_LO_IFACE \ LO_FUNC(ssize_t, writev, const struct iovec *iov, int iovcnt) @@ -100,6 +104,8 @@ LO_INTERFACE(io_bidi_closer); /** * Return bytes-read and bytes-written on success, -errno on error; a * short read/write *is* an error. + * + * It is invalid to call readwritev when the sum length of iovecs is 0. */ #define io_duplex_readwriter_LO_IFACE \ LO_FUNC(void, readwritev, const struct duplex_iovec *iov, int iovcnt) -- cgit v1.2.3-2-g168b