summaryrefslogtreecommitdiff
path: root/libnetio
diff options
context:
space:
mode:
Diffstat (limited to 'libnetio')
-rw-r--r--libnetio/include/libnetio/netio.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/libnetio/include/libnetio/netio.h b/libnetio/include/libnetio/netio.h
index 9383c54..370d2ca 100644
--- a/libnetio/include/libnetio/netio.h
+++ b/libnetio/include/libnetio/netio.h
@@ -12,7 +12,14 @@ int netio_listen(uint16_t port);
int netio_accept(int sock);
/** Return bytes-read on success, 0 on EOF, -errno on error; a short read is *not* an error. */
ssize_t netio_read(int conn, void *buf, size_t count);
-/** Return `count` on success, -errno on error; a short write *is* an error. */
+/**
+ * Return `count` on success, -errno on error; a short write *is* an
+ * error.
+ *
+ * Writes are *not* guaranteed to be atomic (as this would be
+ * expensive to implement), so if you have concurrent writers then you
+ * should arrange for a mutex to protect the connection.
+ */
ssize_t netio_write(int conn, void *buf, size_t count);
/** Return 0 on success, -errno on error. */
int netio_close(int conn, bool rd, bool wr);