explain_setpgid_or_die(3)
π explain_setpgid_or_die(3) π
okay bestie, welcome to the Library Functions Manual page for explain_setpgid_or_die(3) β yes that's the whole manual name, we're not being weird about it, it's just the vibe β¨
πΈ NAME πΈ
explain_setpgid_or_die β set process group and report errors π«Ά
β¨ SYNOPSIS β¨
#include <libexplain/setpgid.h>
void explain_setpgid_or_die(pid_t pid, pid_t pgid);
int explain_setpgid_on_error(pid_t pid, pid_t pgid);
π DESCRIPTION π
So the explain_setpgid_or_die function is literally just there to call the setpgid(2) system call. And if that goes badly? An explanation gets printed to stderr β grabbed straight from the explain_setpgid(3) function β and then the process terminates by calling exit(EXIT_FAILURE). no coming back from that one, bestie π
Then there's explain_setpgid_on_error, which also calls the setpgid(2) system call. Same deal on failure: explanation printed to stderr, obtained from explain_setpgid(3). BUT β and this is the key difference, iykyk β this one still returns to the caller. she's giving graceful π
pidβ the pid, exactly as to be passed to thesetpgid(2)system call. no edits, no remixing, just hand it over as-is πpgidβ the pgid, exactly as to be passed to thesetpgid(2)system call. same energy, character for character π
π RETURN VALUE π
explain_setpgid_or_die only returns on success β peep setpgid(2) for more info on that. On failure? It prints an explanation and exits. It does not return. periodt.
explain_setpgid_on_error always returns the value returned by the wrapped setpgid(2) system call. always. every single time. π¦
π EXAMPLE π
explain_setpgid_or_die is intended to be used in a fashion similar to the following example:
explain_setpgid_or_die(pid, pgid);
like... that's it. that's the whole thing. slay π
π₯ SEE ALSO π₯
setpgid(2)β set process groupexplain_setpgid(3)β explainsetpgid(2)errorsexit(2)β terminate the calling process
π COPYRIGHT π
libexplain version 1.4 Copyright (C) 2011 Peter Miller
and that's a wrap on explain_setpgid_or_die(3) π«Ά this page came to you courtesy of libexplain version 1.4, copyright (C) 2011 Peter Miller β go forth and set those process groups, bestie, and may your stderr stay quiet πΈβ¨π
π¦ 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) 2011 Peter Miller
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms