extern size_t
io_read(file_pair *pair, io_buf *buf, size_t size)
{
- // We use small buffers here.
- assert(size < SSIZE_MAX);
+ assert(size <= IO_BUFFER_SIZE);
size_t pos = 0;
static bool
io_write_buf(file_pair *pair, const uint8_t *buf, size_t size)
{
- assert(size < SSIZE_MAX);
+ assert(size <= IO_BUFFER_SIZE);
while (size > 0) {
const ssize_t amount = write(pair->dest_fd, buf, size);
///
/// \param pair File pair having the source file open for reading
/// \param buf Destination buffer to hold the read data
-/// \param size Size of the buffer; assumed be smaller than SSIZE_MAX
+/// \param size Size of the buffer; must be at most IO_BUFFER_SIZE
///
/// \return On success, number of bytes read is returned. On end of
/// file zero is returned and pair->src_eof set to true.
///
/// \param pair File pair having the destination file open for writing
/// \param buf Buffer containing the data to be written
-/// \param size Size of the buffer; assumed be smaller than SSIZE_MAX
+/// \param size Size of the buffer; must be at most IO_BUFFER_SIZE
///
/// \return On success, zero is returned. On error, -1 is returned
/// and error message printed.