NN_STRERROR(3)
π NN_STRERROR(3) π
okay bestie, sit down, we're doing nanomsg error messages and honestly? it's giving helpful. this is from the nanomsg manual, version 1.2.2, and it's literally the nicest little function. π
β¨ NAME β¨
nn_strerror β turn an error number into a human-readable string π¦
like, an actual sentence a person can read instead of a cursed integer. no cap.
πΈ SYNOPSIS πΈ
#include <nanomsg/nn.h>
const char *nn_strerror (int errnum);
π DESCRIPTION π
So here's the tea: nn_strerror takes an error number (that's your errno, bestie) and converts it into a human-readable string. Simple. Iconic. Slay.
And here's the part where it lowkey outshines the competition: as opposed to strerror(3), this function handles nanomsg-specific errors in addition to standard system errors. so it's strerror(3) but with main character energy β it knows about the nanomsg stuff too, not just the regular system stuff. periodt. π
π«Ά RETURN VALUE π«Ά
It returns the error message string. that's it, that's the whole vibe. a const char * pointing at words that explain what went wrong. π
π ERRORS π
No errors are defined.
literally none. zero. the error function has no errors. it's that girl. she's unproblematic. πβ¨
π EXAMPLE π
rc = nn_send (s, "ABC", 3, 0);
if (rc < 0)
printf ("nn_send failed: %s\n", nn_strerror (errno));
see how we check if rc < 0 and then just print the vibe-check result? chef's kiss. that's the pattern, use it, it's free. π
π SEE ALSO π
go read those too, iykyk. π§
π AUTHORS π
Martin Sustrik <sustrik@250bpm.com> β thank you for your service, king. π
and that's the whole page, bestie!! π this one was written by Martin Sustrik and it comes to you from the nanomsg 1.2.2 era, dated 2026-01-16. now go forth and print readable errors, you absolute legend. π
πΈπ¦
π¦ where this page comes from
- fedora 44: nanomsg-devel 1.2.2-2.fc44 Β· MIT
- fedora 44: nanomsg-devel 1.2.2-2.fc44 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms