NODEUPDOWN_GET_UP_NODES_LIST(3)

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

✨ NODEUPDOWN_GET_UP_NODES_LIST ✨

okay bestie, welcome to nodeupdown_get_up_nodes_list(3), nodeupdown_get_down_nodes_list(3) β€” part of the LIBNODEUPDOWN manual, third section, the library calls, you know the vibe πŸ’–


🌸 NAME 🌸

nodeupdown_get_up_nodes_list, nodeupdown_get_down_nodes_list β€” bestie, these two literally just get you the up nodes or the down nodes. that's it. that's the whole job. πŸ¦‹


πŸŽ€ SYNOPSIS πŸŽ€

#include <nodeupdown.h>

int nodeupdown_get_up_nodes_list(nodeupdown_t handle, char **list, int
len);

int nodeupdown_get_down_nodes_list(nodeupdown_t handle, char **list, int
len);

πŸ’… DESCRIPTION πŸ’…

so nodeupdown_get_up_nodes_list() goes and fetches you a list of all the nodes that are up, and it drops each node name into the list that list points at. and len? that's you telling it how many nodes you can actually fit in list. don't lie to it, it will find out. 😭

nodeupdown_get_down_nodes_list() is the exact same thing, no cap β€” identical in every way β€” except it hands you the down nodes instead. same energy, opposite outcome. 🫢

okay so real talk: to avoid passing in a list that isn't big enough to hold all the up or down nodes, use nodeupdown_nodelist_create(3) to make your list. it's guaranteed to be large enough for every single node. save yourself the heartbreak. πŸ’€

⭐ RETURN VALUES ⭐

slay, here's the deal:

  • on success, it returns the number of nodes it copied into list πŸ‘‘
  • on error, it returns -1, and an error code gets stashed in handle

you can grab that error code with nodeupdown_errnum(3), and get a lil description of what went wrong with nodeupdown_strerror(3). the error codes themselves are all defined in nodeupdown.h, iykyk. 🌈


πŸ’– ERRORS πŸ’–

here's every single one, bestie, no skipping:

  • NODEUPDOWN_ERR_NULLHANDLE β€” the handle parameter is NULL. you gotta make that nodeupdown handle with nodeupdown_handle_create(3) first. it's giving "forgot the main character." πŸŽ€
  • NODEUPDOWN_ERR_NOTLOADED β€” nodeupdown_load_data(3) has not been called, and no data has been retrieved. no data, no list, periodt. πŸ’…
  • NODEUPDOWN_ERR_PARAMETERS β€” an incorrect parameter got passed in. wrong vibe, rejected. πŸ™ˆ
  • NODEUPDOWN_ERR_NULLPTR β€” there's a null pointer hanging out in the list you passed in. 😭
  • NODEUPDOWN_ERR_OVERFLOW β€” the list that list points to is not large enough to store all the nodes. it overflowed. it's over. πŸ’€
  • NODEUPDOWN_ERR_OUTMEM β€” malloc(3) failed internally. the memory said no. πŸ”₯
  • NODEUPDOWN_ERR_CLUSTERLIST_MODULE β€” internal error with the clusterlist module. not your fault, lowkey. πŸ¦‹
  • NODEUPDOWN_ERR_HOSTLIST β€” the Hostlist API has failed internally. it's giving chaos. 🌸
  • NODEUPDOWN_ERR_MAGIC β€” handle has an incorrect magic number. either handle doesn't point to a nodeupdown handle at all, or it's already been destroyed by nodeupdown_handle_destroy(3). the magic is gone, bestie. ✨

🧚 FILES 🧚

  • /usr/include/nodeupdown.h

🌈 SEE ALSO 🌈

libnodeupdown(3), nodeupdown_handle_create(3), nodeupdown_load_data(3), nodeupdown_get_up_nodes_string (3), nodeupdown_get_down_nodes_string (3), nodeupdown_errnum(3), nodeupdown_strerror(3)


and that's the whole page, bestie, you ate it πŸ’… this iconic lil number comes to you from LLNL, dated August 2003 β€” yeah, it's vintage, and it still slays. bye bye, go read some more manpages 🫢✨

πŸ“¦ where this page comes from