EXPLAIN_GETRESGID_OR_DIE(3)

πŸ“¦
version 1.4.D001 Β· 2 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu resolute

πŸ’– explain_getresgid_or_die(3) πŸ’–

okay bestie, welcome to the Library Functions Manual page for explain_getresgid_or_die(3) β€” yes the whole vibe is "get your real/effective/saved group IDs and if it goes wrong we SCREAM about it", and honestly? iconic. let's get into it 🫢


✨ NAME ✨

explain_getresgid_or_die β€” grab your r/e/s group IDs and report errors like a main character πŸ’…


🌸 SYNOPSIS 🌸

#include <libexplain/getresgid.h>
void explain_getresgid_or_die(gid_t *rgid, gid_t *egid, gid_t *sgid);
int explain_getresgid_on_error(gid_t *rgid, gid_t *egid, gid_t *sgid);

πŸ¦‹ DESCRIPTION πŸ¦‹

so. the explain_getresgid_or_die</p> function is literally just here to call the getresgid(2) system call for you. and if that call fails?? an explanation gets printed to stderr, pulled straight from the explain_getresgid(3) function, and then the process terminates by calling exit(EXIT_FAILURE). dramatic? yes. necessary? also yes. πŸ’€

meanwhile, the explain_getresgid_on_error</p> function also calls the getresgid(2) system call. on failure it also prints an explanation to stderr (again, courtesy of explain_getresgid(3)), but this one is chill β€” it still returns to the caller. no exit, no chaos, just vibes 🌈

  • rgid β€” the rgid, exactly as to be passed to the getresgid(2) system call. no edits, no notes, pass it exactly πŸŽ€
  • egid β€” the egid, exactly as to be passed to the getresgid(2) system call. same energy fr fr ✨
  • sgid β€” the sgid, exactly as to be passed to the getresgid(2) system call. periodt πŸ’…

πŸ‘‘ RETURN VALUE πŸ‘‘

the explain_getresgid_or_die</p> function only returns on success β€” check getresgid(2) for more info on that. on failure it prints an explanation and exits, so like... it does not return. it simply leaves. πŸšͺπŸ’¨

the explain_getresgid_on_error</p> function always returns the value returned by the wrapped getresgid(2) system call. every single time, no cap 🫢


⭐ EXAMPLE ⭐

the explain_getresgid_or_die function is intended to be used in a fashion similar to the following example:

explain_getresgid_or_die(rgid, egid, sgid);

that's it. that's the whole flex. short, sweet, ate πŸ’–


πŸ”₯ SEE ALSO πŸ”₯


libexplain version 1.4 Copyright (C) 2012 Peter Miller


and that's the whole page bestie!! go forth, call your getresgid(2), and let the library handle the explaining πŸ’– this was explain_getresgid_or_die(3), from the Library Functions Manual, brought to you by libexplain version 1.4, copyright (C) 2012 Peter Miller β€” mwah, take care of urself πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from