flow_read, flow_write - read and write from/to a flow
#include <ouroboros/dev.h>
ssize_t flow_read(int fd, void * buf, size_t count);
ssize_t flow_write(int fd, const void * buf, size_t count);
Compile and link with -louroboros-dev.
The flow_read() function attempts to read at most count bytes from the flow associated with the allocated flow descriptor fd into the buffer pointed to by buf.
The flow_write() function attempts to write count bytes from the supplied buffer buf to the flow specified by fd.
On success, flow_read() returns the number of bytes read. On 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 flow_read() should be performed to check if there were more bytes to read. This call to flow_read will return 0 if there was no more data and mark the end of the datagram.
On success, flow_write() 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 buf returns 0 with no other effects.
-EIRMD Failed to contact an IRMd instance.
-EBADF Invalid flow descriptor passed.
-ENOTALLOC The flow was not allocated.
-EFLOWDOWN The flow has been reported down.
-EFLOWPEER The flow's peer is unresponsive (flow timed out).
-EMSGSIZE The buffer was too large to be written.
For an explanation of the terms used in this section, see attributes(7).
|
fccntl(3), flow_alloc(3), fqueue(3), fset(3), ouroboros(8)
These man pages are licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/