EXPLAIN_GETRESGID_OR_DIE(3)
π 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β thergid, exactly as to be passed to thegetresgid(2)system call. no edits, no notes, pass it exactly πegidβ theegid, exactly as to be passed to thegetresgid(2)system call. same energy fr fr β¨sgidβ thesgid, exactly as to be passed to thegetresgid(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 π₯
getresgid(2)β get real, effective and saved group IDsexplain_getresgid(3)β explaingetresgid(2)errorsexit(2)β terminate the calling process
π COPYRIGHT π
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
- debian bookworm: libexplain-dev 1.4.D001-12+b1 Β· LGPL-3.0-or-later
- debian trixie: libexplain-dev 1.4.D001-16 Β· LGPL-3.0-or-later
- ubuntu jammy: libexplain-dev 1.4.D001-12 Β· LGPL-3.0-or-later
- ubuntu noble: libexplain-dev 1.4.D001-13 Β· LGPL-3.0-or-later
- ubuntu resolute: libexplain-dev 1.4.D001-16 Β· LGPL-3.0-or-later
- Copyright (C) 2012 Peter Miller
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms