Next: , Previous: bpipe_iochannel_read, Up: Internal Functions   [Contents]


A.5.20 bpipe_iochannel_write

Write data to an I/O channel.

Synopsis

#include <bpipe/bpipe.h>

size_t bpipe_iochannel_write(
  const void *buf,
  size_t size,
  size_t n,
  IOchannel *ioc
);

Parameters

const void *buf

the source buffer to write

size_t size

the size of an object to write

size_t n

the number of objects to write

IOchannel *ioc

the I/O channel to write to

Description

This routine writes data to 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 written. Upon error it returns ‘0’ and sets bpipe_errno to BPEIOERR.