GENDERS_GETNODENAME(3)

✨ NAME ✨

ok so this is genders_getnodename from the LIBGENDERS manual (section 3, library calls bestie πŸ’–) β€” it gets you the current node name. that's it. that's the whole vibe. πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <genders.h>

int genders_getnodename(genders_t handle, char *node, int len);

πŸ’… DESCRIPTION πŸ’…

okay so genders_getnodename() literally goes and retrieves the name of the node that the function is being called from. like, this node. the one you're standing on. main character energy fr fr 🌸

the node name it hands back is the shortened hostname of the node, and it gets stored in the buffer that node points to. len should tell it how long that buffer is. and yes β€” the node returned by genders_getnodename() is the shortened hostname of the node. it's giving consistent. it's giving no surprises. ✨

🫢 and to avoid passing in a buffer that is NOT big enough to hold the node name, you should use genders_getmaxnodelen(3) to figure out the minimum buffer size you should be using. do this. don't be the person who gets GENDERS_ERR_OVERFLOW. we've all been there and it's not cute 😭

πŸ”₯ RETURN VALUES πŸ”₯

  • on success, 0 is returned. slay. πŸ‘‘
  • on error, -1 is returned, and an error code is returned in handle. πŸ’€
  • you can grab that error code with genders_errnum(3), and a lil description of what it means with genders_strerror(3).
  • error codes are defined in genders.h. πŸŽ€

😭 ERRORS 😭

  • GENDERS_ERR_NULLHANDLE β€” the handle parameter is NULL. bestie. the genders handle has to be created with genders_handle_create(3) first. you can't skip steps. πŸ™ˆ
  • GENDERS_ERR_NOTLOADED β€” genders_load_data(3) has not been called to load genders data. no data, no node name, no nothing. load it. πŸ“¦
  • GENDERS_ERR_OVERFLOW β€” the buffer pointed to by node is not large enough to store the node name. this is the one I warned you about. genders_getmaxnodelen(3). use it. 🌸
  • GENDERS_ERR_PARAMETERS β€” an incorrect parameter has been passed in. something in there is wrong and the function is politely telling you so. πŸ’…
  • GENDERS_ERR_MAGIC β€” handle has an incorrect magic number. this means handle does not point to a genders handle, or handle has been destroyed by genders_handle_destroy(3). it's gone. it's not coming back. πŸͺ¦

πŸ“ FILES πŸ“

  • /usr/include/genders.h

🌈 SEE ALSO 🌈


ok that's the whole page bestie, you're officially fluent in genders_getnodename 🧚✨ this lil icon of a manpage came from LLNL and it's dated August 2003 β€” yeah, vintage, and still serving πŸ’œ β€” filed under GENDERS_GETNODENAME(3) in the LIBGENDERS collection. go get that node name, you got this πŸ«ΆπŸ’–