explain_wait3_or_die(3)

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

✨ NAME ✨

okay so welcome to the explain_wait3_or_die page bestie πŸ’– β€” this is a little function from the Library Functions Manual that waits for a process to change state, and if that goes sideways it screams about it and then dips. it does not do quiet failure. no cap.


πŸŽ€ SYNOPSIS πŸŽ€

#include <libexplain/wait3.h>
void explain_wait3_or_die(int *status, int options, struct rusage *rusage);

🌸 DESCRIPTION 🌸

so explain_wait3_or_die is basically a glow-up wrapper around the wait3(2) system call. it calls it for you, and if things go bad? it prints a whole explanation to stderr β€” that explanation comes from explain_wait3(3) btw, iconic teamwork β€” and then it just… ends the process by calling exit(EXIT_FAILURE). dramatic? yes. effective? also yes. πŸ’…

the vibe is that you use it in a way similar to this lil example here:

int pid = explain_wait3_or_die(status, options, rusage);

now let's meet the parameters, they each have main character energy ✨

  • status β€” the status, exactly as to be passed to the wait3(2) system call. no changes, no edits, no "i improved it", just pass it straight through 🫢
  • options β€” the options, exactly as to be passed to the wait3(2) system call. same deal, verbatim, don't touch it πŸ™ˆ
  • rusage β€” the rusage, exactly as to be passed to the wait3(2) system call. yes, also exactly. all three of them are "exactly as to be passed", that's the whole bit ✨

Returns:

this function only returns on success. on failure it prints an explanation and exits. that's it, that's the whole return policy 😭 there is no failure return value to check because the process is already gone by then.

πŸ’– SEE ALSO πŸ’–


  • libexplain version 1.4
  • Copyright (C) 2008 Peter Miller

and that's the whole page bestie, slay 🌈 so this was explain_wait3_or_die(3), coming at you from libexplain version 1.4, copyright 2008 Peter Miller, and the footer was feeling very explain_wait3_or_die(3) about the whole thing πŸ¦‹πŸ’œ go wait on a process responsibly, ily, bye πŸ’–

πŸ“¦ where this page comes from