NNG_MSG_DUP(3)

πŸ“¦
version 1.12.0 Β· 4 versions
, in ubuntu stonking

πŸ’– nng_msg_dup(3) β€” NNG Reference Manual πŸ’–

okay bestie, gather round, because this one is literally the dupe button for your messages. it's nng_msg_dup, and yes, she lives in the NNG Reference Manual, and yes, she is giving copy-paste main character energy. ✨


🌸 NAME 🌸

nng_msg_dup β€” duplicate a message 🫢


✨ SYNOPSIS ✨

#include <nng/nng.h>

int nng_msg_dup(nng_msg **dup, nng_msg_t *orig);

πŸ’… DESCRIPTION πŸ’…

so here's the tea: nng_msg_dup() makes a duplicate of the original message orig, and saves the result in the location pointed by dup.

the actual message body and header content is copied β€” like, fully copied, no shortcuts, no cap. πŸŽ€

but listen. the duplicate may contain a different amount of unused space than the original message. not a bug, just how she is. don't come for her. πŸ’€

🌈 RETURN VALUES 🌈

this function returns 0 on success, and non-zero otherwise. that's it, that's the vibe check. πŸ‘‘


πŸ’œ ERRORS πŸ’œ

  • NNG_ENOMEM β€” Insufficient free memory exists to duplicate a message. 😭 bestie the memory said no and honestly we have to respect it.

πŸ¦‹ SEE ALSO πŸ¦‹


and that's the whole page, periodt. πŸ’– this iconic lil entry is brought to you by the NNG Reference Manual, dated 2026-06-30, and she ate fr fr. now go duplicate responsibly, bestie β€” and don't forget to nng_msg_free(3) when you're done, because memory leaks are NOT the aesthetic. 🧚✨

πŸ“¦ where this page comes from