MONGOC_STREAM_READV(3)

πŸ’… MONGOC_STREAM_READV(3) ✨

okay so bestie, we're in libmongoc land and this one is called mongoc_stream_readv β€” say it with me, "read-vee" β€” and honestly? it's giving gathered-I/O main character energy πŸ¦‹


πŸŽ€ SYNOPSIS πŸŽ€

ssize_t
mongoc_stream_readv (mongoc_stream_t *stream,
                     mongoc_iovec_t *iov,
                     size_t iovcnt,
                     size_t min_bytes,
                     int32_t timeout_msec);

like, that's the whole vibe. five args. no notes. πŸ’…


🌸 PARAMETERS 🌸

  • stream β€” a mongoc_stream_t. the stream in question. the one we're reading from. her. πŸ‘‘
  • iov β€” a vector of mongoc_iovec_t. yes, a whole vector, we're doing gathered I/O today and we're doing it fabulously ✨
  • iovcnt β€” the number of items in iov. just a count. keep it honest.
  • min_bytes β€” the minimum number of bytes to read, or failure will be indicated. like, if you don't get at least this many? it's a fail. no cap 😭
  • timeout_msec β€” a timeout in milliseconds, or 0 to indicate non-blocking. a negative value will use the default timeout. (note the wording, bestie: the default timeout β€” see the warning below, it's important 🫢)

so this function is literally identical to mongoc_stream_read() except that it takes a mongoc_iovec_t to perform gathered I/O. same energy, different shape. πŸ’–

⚠️ WARNING ⚠️ listen up because this one matters: the "default timeout" indicated by a negative value is both unspecified and unrelated to the documented default values for *TimeoutMS URI options. so do NOT go assuming they're the same thing, they are not, they're strangers πŸ’€ To specify a default timeout value for a *TimeoutMS URI option, use the MONGOC_DEFAULT_* constants defined in mongoc-client.h. that's the actual way. periodt.

🌈 RETURNS 🌈

>= 0 on success, -1 on failure and errno is set. slay when it works, check errno when it doesn't πŸ”₯

πŸ¦‹ SEE ALSO πŸ¦‹

  • mongoc_stream_read()
  • mongoc_stream_write()
  • mongoc_stream_writev()

the whole friend group. go read them too, iykyk πŸ’œ


⭐ AUTHOR ⭐

MongoDB, Inc β€” icons only πŸ‘‘

2009-present, MongoDB, Inc. β€” protect it, respect it πŸ’…


okay that's the page!! mwah 🫢 this was libmongoc 2.5.6, dated Oct 09, 2026, and yes the header and footer said MONGOC_STREAM_READV(3) three whole times because manpages are dramatic like that 😭 go forth and gather your I/O bestie 🧚✨

πŸ“¦ where this page comes from