explain_putenv_or_die(3)

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

πŸ’– NAME πŸ’–

okay bestie, welcome to explain_putenv_or_die(3) β€” the manual page that's literally about changing or adding an environment variable and reporting errors like a boss. we're folding the manual name right here near the top so you know what's up: this is the explain_putenv_or_die(3) page, and it's giving helpful-library-energy. ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <libexplain/putenv.h>
void explain_putenv_or_die(char *string);
int explain_putenv_on_error(char *string);

🌸 DESCRIPTION 🌸

so here's the tea, bestie. the explain_putenv_or_die function is used to call the putenv(3) system call. on failure, an explanation will be printed to stderr, obtained from the explain_putenv(3) function, and then the process terminates by calling exit(EXIT_FAILURE). like, it does not come back. periodt. πŸ’€

the explain_putenv_on_error function is also used to call the putenv(3) system call. on failure, an explanation will be printed to stderr, obtained from the explain_putenv(3) function, but still returns to the caller. so it's the chill one that doesn't dip out on you. 🫢

  • string β€” the string, exactly as to be passed to the putenv(3) system call. no cap, exactly as-is.

πŸ‘‘ RETURN VALUE πŸ‘‘

the explain_putenv_or_die function only returns on success, see putenv(3) for more information. on failure, it prints an explanation and exits β€” it does not return. it's giving "no takebacks." 😭

the explain_putenv_on_error function always returns the value return by the wrapped putenv(3) system call. yes, "return" β€” we said what we said. πŸ’…


🌈 EXAMPLE 🌈

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

explain_putenv_or_die(string);

see? iconic. simple. slay. ✨


πŸ”₯ SEE ALSO πŸ”₯


libexplain version 1.4 Copyright (C) 2010 Peter Miller


okay bestie, that's the whole page. it was explain_putenv_or_die(3), brought to you by libexplain version 1.4, copyright 2010 Peter Miller β€” and yes, the footer energy is still explain_putenv_or_die(3). stay hydrated, read your manpages, and don't forget to check your return values. mwah. πŸ’–πŸ¦‹βœ¨

πŸ“¦ where this page comes from