]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
fd: Improve documentation of write_all().
authorAndre Noll <maan@tuebingen.mpg.de>
Thu, 22 Sep 2022 20:34:14 +0000 (22:34 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 26 Mar 2023 14:30:56 +0000 (16:30 +0200)
The name of this public function is a bit of a misnomer, so be at
least clear in the one-line description what the function does in
the EAGAIN case or if a short write occurs.

fd.c

diff --git a/fd.c b/fd.c
index 5d23babf38c70e85765931d9ac0c0b0eb4730e37..180032daa6d0f7bf11a63984480842b007c316c6 100644 (file)
--- a/fd.c
+++ b/fd.c
@@ -126,14 +126,15 @@ int xwrite(int fd, const char *buf, size_t len)
 }
 
 /**
- * Write all data to a file descriptor.
+ * Write to a file descriptor, fail on short writes.
  *
  * \param fd The file descriptor.
- * \param buf The buffer to be sent.
- * \param len The length of \a buf.
+ * \param buf The buffer to be written.
+ * \param len The length of the buffer.
  *
- * This is like \ref xwrite() but returns \p -E_SHORT_WRITE if not
- * all data could be written.
+ * For blocking file descriptors this function behaves identical to \ref
+ * xwrite(). For non-blocking file descriptors it returns -E_SHORT_WRITE
+ * (rather than a value less than len) if not all data could be written.
  *
  * \return Number of bytes written on success, negative error code else.
  */