summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2020-03-14 17:52:06 +0100
committerSander Vrijders <sander@ouroboros.rocks>2020-03-15 14:30:58 +0100
commit51d8f69fb152ae5a47151c2f132fd4263ec3d144 (patch)
tree67ef7b137bc00fdbb93774aa8ccbbbb39975ace0 /doc
parentb977090a7692acada4b81677e88c5a5e60a153c3 (diff)
downloadouroboros-0.17.0.tar.gz
ouroboros-0.17.0.zip
lib: Return number of written bytes on flow_write0.17.0
This is more in line with the write() system call and prepares for partial writes. Partial writes are disabled by default (and not yet implemented). Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'doc')
-rw-r--r--doc/man/fccntl.35
-rw-r--r--doc/man/flow_read.324
2 files changed, 17 insertions, 12 deletions
diff --git a/doc/man/fccntl.3 b/doc/man/fccntl.3
index b0f1b3fb..87e23078 100644
--- a/doc/man/fccntl.3
+++ b/doc/man/fccntl.3
@@ -60,7 +60,10 @@ argument. Supported flags are:
\fIFLOWFRNOPART\fR - disable partial reading.
-\fIFLOWFDEFAULT\fR - set flow defaults (blocking, read-write).
+\fIFLOWFWNOPART\fR - disable partial writing.
+
+\fIFLOWFDEFAULT\fR - set flow defaults (blocking, read-write,
+no partial writes).
.RE
diff --git a/doc/man/flow_read.3 b/doc/man/flow_read.3
index 655f50b2..1a6c8eaf 100644
--- a/doc/man/flow_read.3
+++ b/doc/man/flow_read.3
@@ -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