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β amongoc_stream_t. the stream in question. the one we're reading from. her. πiovβ a vector ofmongoc_iovec_t. yes, a whole vector, we're doing gathered I/O today and we're doing it fabulously β¨iovcntβ the number of items iniov. 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, or0to 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*TimeoutMSURI 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*TimeoutMSURI option, use theMONGOC_DEFAULT_*constants defined inmongoc-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 π
π COPYRIGHT π
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
- epel 10: mongo-c-driver-devel 2.5.6-1.el10_3 Β· Apache-2.0 AND ISC AND MIT AND Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms