aboutsummaryrefslogtreecommitdiffstats
path: root/src/message.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/message.h')
-rw-r--r--src/message.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/message.h b/src/message.h
index 15ceaf7..d1d6840 100644
--- a/src/message.h
+++ b/src/message.h
@@ -120,13 +120,14 @@ size_t message_unmarshal(struct message* this, const void* buf);
*
* @param this Memory slot in which to store the new message
* @param fd The file descriptor
- * @return Non-zero on error or interruption, `errno` will be
- * set accordingly. Destroy the message on error,
- * be aware that the reading could have been
- * interrupted by a signal rather than canonical error.
- * If -2 is returned `errno` will not have been set,
- * -2 indicates that the message is malformated,
- * which is a state that cannot be recovered from.
+ * @return 0: At least one message is available
+ * -1: Exceptional connection:
+ * EINTR: System call interrupted
+ * EAGAIN: No message is available
+ * EWOULDBLOCK: No message is available
+ * ECONNRESET: Connection closed
+ * Other: Failure
+ * -2: Corrupt message (unrecoverable)
*/
int message_read(struct message* this, int fd);