diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-04-26 23:30:31 -0600 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-05-12 13:02:05 -0600 |
commit | 42729f477684b12735b572a4975d32fb1002a530 (patch) | |
tree | 8edcd3eede207af6d9ae2557f8fcb05290659597 /libhw_generic/include/libhw/generic/io.h | |
parent | 5255dbd5196f0125b51d969c46e46ac5765db7ed (diff) |
libhw_generic: io.h: Clarify that sum lenghts of iovecs must not be 0
Diffstat (limited to 'libhw_generic/include/libhw/generic/io.h')
-rw-r--r-- | libhw_generic/include/libhw/generic/io.h | 6 |
1 files changed, 6 insertions, 0 deletions
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) |