summaryrefslogtreecommitdiff
path: root/doc/man/flow_read.3
diff options
context:
space:
mode:
Diffstat (limited to 'doc/man/flow_read.3')
-rw-r--r--doc/man/flow_read.335
1 files changed, 20 insertions, 15 deletions
diff --git a/doc/man/flow_read.3 b/doc/man/flow_read.3
index 20f5b976..acc1f61e 100644
--- a/doc/man/flow_read.3
+++ b/doc/man/flow_read.3
@@ -1,6 +1,6 @@
-.\" Ouroboros man pages CC-BY 2017 - 2018
-.\" Dimitri Staessens <dimitri.staessens@ugent.be>
-.\" Sander Vrijders <sander.vrijders@ugent.be>
+.\" Ouroboros man pages CC-BY 2017 - 2024
+.\" Dimitri Staessens <dimitri@ouroboros.rocks>
+.\" Sander Vrijders <sander@ouroboros.rocks>
.TH FLOW_READ 3 2017-04-10 Ouroboros "Ouroboros Programmer's Manual"
@@ -12,9 +12,9 @@ flow_read, flow_write \- read and write from/to a flow
.B #include <ouroboros/dev.h>
-\fBint flow_read(int \fIfd\fB, void * \fIbuf\fB, size_t \fIcount\fB);\fR
+\fBssize_t flow_read(int \fIfd\fB, void * \fIbuf\fB, size_t \fIcount\fB);\fR
-\fBint flow_write(int \fIfd\fB, const void * \fIbuf\fB, size_t \fIcount\fB);\fR
+\fBssize_t flow_write(int \fIfd\fB, const void * \fIbuf\fB, size_t \fIcount\fB);\fR
Compile and link with \fI-louroboros-dev\fR.
@@ -30,15 +30,17 @@ from the supplied buffer \fIbuf\fR to the flow specified by \fIfd\fR.
.SH RETURN VALUE
On success, \fBflow_read\fR() returns the number of bytes read. On
-failure, a negative value indicating the error will be returned. If
-the number of bytes read equals count, a subsequent call to
-\fBflow_read\fR() should be performed to check if there were more
-bytes to read. This call to \fBflow_read\fR will return 0 if there was
-no more data and mark the end of the datagram.
-
-On success, \fBflow_write\fR() returns 0. On failure, a negative value
-indicating the error will be returned. Passing a NULL pointer for
-\fIbuf\fR returns 0 with no other effects.
+failure, a negative value indicating the error will be
+returned. Partial reads are enabled by default. If the number of bytes
+read equals count, a subsequent call to \fBflow_read\fR() should be
+performed to check if there were more bytes to read. This call to
+\fBflow_read\fR will return 0 if there was no more data and mark the
+end of the datagram.
+
+On success, \fBflow_write\fR() returns the number of bytes written. On
+failure, a negative value indicating the error will be returned.
+Partial writes needs to be explicitly enabled. Passing a
+NULL pointer for \fIbuf\fR returns 0 with no other effects.
.SH ERRORS
.B -EINVAL
@@ -56,6 +58,9 @@ The flow was not allocated.
.B -EFLOWDOWN
The flow has been reported down.
+.B -EFLOWPEER
+The flow's peer is unresponsive (flow timed out).
+
.B -EMSGSIZE
The buffer was too large to be written.
@@ -84,7 +89,7 @@ ouroboros (8)
.SH COLOPHON
This page is part of the Ouroboros project, found at
-http://ouroboros.ilabt.imec.be
+http://ouroboros.rocks
These man pages are licensed under the Creative Commons Attribution
4.0 International License. To view a copy of this license, visit