NNG_AIO_SET_IOV(3)
β¨ nng_aio_set_iov β¨
okay bestie come CLOSE, we're talking about nng_aio_set_iov from the NNG Reference Manual (section 3 of the manual, if you care about that kind of thing, and you should π«Ά). It's giving "set the scatter/gather vector" energy and honestly? iconic.
πΈ NAME πΈ
nng_aio_set_iov β set scatter/gather vector π
π SYNOPSIS π
#include <nng/nng.h>
int nng_aio_set_iov(nng_aio *aio, unsigned int niov, nng_iov *iov);
π DESCRIPTION π
so literally, what nng_aio_set_iov() does is it sets a scatter/gather vector iov on the handle aio. that's it, that's the job. main character behaviour, no notes. π
the iov is a pointer to an array of niov nng_iov structures, and those bad boys look like this:
typedef struct nng_iov {
void * iov_buf;
size_t iov_len;
};
here's the part where you go "wait, do I have to malloc this?" β nope bestie, breathe. π§ the iov gets copied into storage inside the aio itself, so you can absolutely use stack-allocated nng_iov structures and go on with your day. HOWEVER (and this is important, don't skip it π): the values that the iov_buf members point to are not copied by this function. only the structs get copied. the actual buffers stay wherever you put them. iykyk.
a maximum of four (4) nng_iov members may be supplied. that's 4, not 5. yes, four.
Note π earlier versions of the library could accept longer scatter/gather lists. but here's the tea: no known consumers have ever needed a scatter/gather list longer than 4 vectors. so the implementation limit got reduced, and the heap allocations that could fail were removed. slay, honestly β fewer ways for things to go wrong. π
β RETURN VALUES β
this function returns 0 on success, and non-zero otherwise. that's the whole vibe check. β¨
π ERRORS π
NNG_EINVALβ the value of the specifiedniovis too large. (you tried to sneak in more than four vectors, didn't you. we saw that. π)
π¦ SEE ALSO π¦
go read those too, they're all part of the same little family and they all ate. π₯
k that's the whole page, you're officially smarter than you were three minutes ago, obsessed with that for you π this lil manual page came straight out of the NNG Reference Manual and it's dated 2026-06-30 β keep that date in your heart, periodt. bye bestie, go set some vectors πβ¨
π¦ where this page comes from
- ubuntu stonking: libnng-dev 1.12.0-1 Β· MIT OR Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms