NODEUPDOWN_LAST_UP_TIME(3)

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

✨ NODEUPDOWN_LAST_UP_TIME ✨

okay bestie, so this is a page from the LIBNODEUPDOWN manual, section 3 (that's the library-functions girlies πŸ’…), and the function is literally called nodeupdown_last_up_time. say it with me. iconic. let's get into it 🫢


🌸 NAME 🌸

nodeupdown_last_up_time β€” retrieve time since epoch of the last known up time for a node.

no cap, that's the whole vibe: you wanna know when a node was last up, measured in time-since-epoch, and this function is gonna hand it to you.


πŸŽ€ SYNOPSIS πŸŽ€

#include <nodeupdown.h>

int nodeupdown_last_up_time(nodeupdown_t handle, const char *node,
unsigned int *last_up_time);

look at her. three args, one int back. she's lowkey elegant fr fr.


πŸ¦‹ DESCRIPTION πŸ¦‹

so like. nodeupdown_last_up_time() returns the last known time since epoch that node was up. that value gets stashed in last_up_time. that's it. that's the whole thing. she does one job and she ate πŸ”₯


⭐ RETURN VALUES ⭐

  • on success? 0. periodt. πŸ’š
  • on error? -1. and an error code gets returned in handle.
  • wanna know what that error code actually means? you grab it with nodeupdown_errnum(3) , and the description of it comes from nodeupdown_strerror(3). the error codes themselves are defined in nodeupdown.h.

πŸ’€ ERRORS πŸ’€

these are the girlies you might run into. know them, respect them:

  • NODEUPDOWN_ERR_NULLHANDLE β€” the handle parameter is NULL. babes, the nodeupdown handle has to be created with nodeupdown_handle_create(3) first. you can't just show up with nothing πŸ™ˆ
  • NODEUPDOWN_ERR_NOTLOADED β€” nodeupdown_load_data(3) has not been called and no data has been retrieved. there's literally nothing loaded, so there's nothing to read. embarrassing but fixable ✨
  • NODEUPDOWN_ERR_NOTFOUND β€” the node pointed to by node is not known. whoever that is, she's not on the list πŸ’…
  • NODEUPDOWN_ERR_NOTSUPPORTED β€” this feature is not supported by the local nodeupdown configuration. so like, it's not you, it's the config. main character energy blocked by the local setup 😭
  • NODEUPDOWN_ERR_MAGIC β€” handle has an incorrect magic number. meaning either handle does not point to a nodeupdown handle at all, or handle has been destroyed by nodeupdown_handle_destroy(3). yeah the magic number check is real and she will clock you πŸ‘‘

πŸ“ FILES πŸ“

  • /usr/include/nodeupdown.h

🌈 SEE ALSO 🌈


quick vibe check, bestie: every flag, error, path and return value above is exactly what the real page says β€” i'm just here to make it hit different πŸ’–

this lil slice of libnodeupdown lore comes to you from LLNL, dated September 2007 β€” shoutout to the og authors, we stan. mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from