Next: , Previous: bpipe_iochannel_open, Up: Internal Functions


A.5.19 bpipe_iochannel_read

read data from an I/O channel.

Synopsis

     #include <bpipe/bpipe.h>
     
     
     
size_t bpipe_iochannel_read( void *buf, size_t size, size_t n, IOchannel *ioc );

Parameters

void *buf
the destination buffer to fill
size_t size
the size of an object to be read
size_t n
the number of objects to read
IOchannel *ioc
the I/O channel to read from

Description

This routine reads data from an I/O channel. Because of the idiosyncracies of the various OS's implementation of fread, it isn't as efficient as it can be, nor does it return as much information as might be available.

Returns

It returns the number of objects read. Upon error it returns ‘0’ and sets bpipe_errno to BPEIOERR.