NODEUPDOWN_ERRNUM(3)

πŸ“¦ version 1.14, in epel 9, fedora 43, fedora 44

πŸŽ€ NODEUPDOWN_ERRNUM β€” the error-handling girlies of libnodeupdown πŸŽ€

okay so bestie, this page is all about the error routines in the libnodeupdown library, and it's literally the group chat of four functions that tell you what went wrong: nodeupdown_errnum, nodeupdown_strerror, nodeupdown_errormsg, and nodeupdown_perror. they're all in the NODEUPDOWN_ERRNUM(3) era and honestly? iconic. ✨


πŸ’– NAME πŸ’–

nodeupdown_errnum, nodeupdown_strerror, nodeupdown_errormsg, nodeupdown_perror β€” the nodeupdown error routines 🫢


✨ SYNOPSIS ✨

okay so first you gotta bring the header into the room:

#include <nodeupdown.h>

and here's the whole squad, in their exact fits:

int nodeupdown_errnum(nodeupdown_t handle);

char *nodeupdown_strerror(int errnum);

char *nodeupdown_errormsg(nodeupdown_t handle);

void nodeupdown_perror(nodeupdown_t handle, const char *msg);

🌸 DESCRIPTION 🌸

nodeupdown_errnum() β€” she returns the error code that's stored in handle. that's it, that's the job. πŸ’…

nodeupdown_strerror() β€” she returns a pointer to a string that describes the error code errnum. so basically she's the translator who turns a number into actual words. πŸ¦‹

ngl the usual flow is: you grab the error code with nodeupdown_errnum(), then you hand it over to nodeupdown_strerror() so it can tell you what it means. bestie behavior fr fr.

nodeupdown_errormsg() β€” she returns a pointer to a string describing the error stored in handle. and the way that she works is logically equivalent to this whole thing:

char *nodeupdown_strerror(nodeupdown_errnum(nodeupdown_t handle));

so if you were thinking "wait, isn't this just those other two functions stacked" β€” yeah, you clocked it, no cap. πŸ’€

nodeupdown_perror() β€” she's basically perror(3)'s cousin, lowkey. she puts a message on standard error output describing the error stored in handle. and here's the cute part: if msg is not NULL, then the string pointed to by msg, a colon, and a blank are all printed before the error message. like a little intro, a little garnish, a little main character entrance. πŸ‘‘


πŸŽ€ FILES πŸŽ€

  • /usr/include/nodeupdown.h

vibe check passed β€” remember, error codes aren't scary, they're just the library telling you how it feels. πŸ˜­πŸ’–

and that's the whole page bestie!! this lil manual came from LLNL, dated August 2003, and it lives under the LIBNODEUPDOWN label with the page name NODEUPDOWN_ERRNUM(3). stay hydrated, check your return values, and slay βœ¨πŸ’œ

πŸ“¦ where this page comes from