SYNOPSIS

ssize_t
mongoc_gridfs_file_readv (mongoc_gridfs_file_t *file,
                          mongoc_iovec_t         *iov,
                          size_t                iovcnt,
                          size_t                min_bytes,
                          uint32_t              timeout_msec);

ssize_t
mongoc_gridfs_file_writev (mongoc_gridfs_file_t *file,
                           mongoc_iovec_t         *iov,
                           size_t                iovcnt,
                           uint32_t              timeout_msec);

DESCRIPTION

mongoc_gridfs_file_readv()

The mongoc_gridfs_file_readv() function fulfills the interface in mongoc_stream_readv(3) and mimics readv(2).

iov

an array of io vectors to read into

iovcnt

The size of iov

min_bytes

The minimum number of bytes to read. Blocks and reads until that many bytes are read, eof or a timeout.

timeout_msec

The number of milliseconds to attempt to read min_bytes before returning -1 and setting errno = ETIMEDOUT

mongoc_gridfs_file_writev()

The mongoc_gridfs_file_writev() function fulfills the interface in mongoc_stream_writev(3) and mimics writev(2).

iov

an array of io vectors to write into

iovcnt

The size of iov

timeout_msec

The number of milliseconds to attempt to write min_bytes before returning -1 and setting errno = ETIMEDOUT

RETURN VALUE

The mongoc_gridfs_file_readv() and mongoc_gridfs_file_writev() functions return the number of bytes read on success. If the return is less than min_bytes, eof was encountered. If the return is less than 0 an error was encountered and errno should be set.

ERRORS

ETIMEDOUT

The read or write could not be satisfied in the time available

SEE ALSO

AUTHORS

This page was written by MongoDB Inc.