---
name: "mongoc_gridfs_file_readv"
section: "3"
platform: "linux"
package: "libmongoc-doc"
version: "1.30.4-1+deb13u3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/mongoc_gridfs_file_readv"
---

# mongoc\_gridfs\_file\_readv(3)

## 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);
```

## PARAMETERS

- •

  **file**: A *mongoc\_gridfs\_file\_t*.

- •

  **iov**: An array of *mongoc\_iovec\_t*.

- •

  **iovcnt**: The number of elements in **iov**.

- •

  **min\_bytes**: The minimum number of bytes that must be read or an error will be synthesized.

- •

  **timeout\_msec**: Unused.

## DESCRIPTION

This function performs a scattered read from **file**, potentially blocking to read from the MongoDB server.

The **timeout\_msec** parameter is unused.

## RETURNS

Returns the number of bytes read, or -1 on failure. Use *mongoc\_gridfs\_file\_error()* to retrieve error details.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
