explain_mount_or_die(3)

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

✨ explain_mount_or_die ✨

okay bestie, welcome to the libexplain corner of the manual, where we mount file systems and we do NOT play about errors πŸ’… this one lives in section 3, the Library Functions Manual, and it's giving "mount it or die trying" energy πŸŽ€


🌸 NAME 🌸

explain_mount_or_die β€” mount file system and report errors πŸ¦‹


πŸ’– SYNOPSIS πŸ’–

#include <libexplain/mount.h>
void explain_mount_or_die(const char *source, const char *target, const char
*file_systems_type, unsigned long flags, const void *data);
int explain_mount_on_error(const char *source, const char *target, const char
*file_systems_type, unsigned long flags, const void *data);

✨ DESCRIPTION ✨

okay so. The explain_mount_or_die function is used to call the mount(2) system call. On failure an explanation will be printed to stderr, obtained from the explain_mount(3) function, and then the process terminates by calling exit(EXIT_FAILURE). like, it's literally over. bye. πŸ’€

The explain_mount_on_error function is used to call the mount(2) system call. On failure an explanation will be printed to stderr, obtained from the explain_mount(3) function, but still returns to the caller. softer vibes, still tells you what went wrong 🫢

  • source β€” the source, exactly as to be passed to the mount(2) system call.
  • target β€” the target, exactly as to be passed to the mount(2) system call.
  • file_systems_type β€” the file_systems_type, exactly as to be passed to the mount(2) system call.
  • flags β€” the flags, exactly as to be passed to the mount(2) system call.
  • data β€” the data, exactly as to be passed to the mount(2) system call.
not me stressing that all five of these are passed exactly as-is. no remixing, no editing, no "i improved it". the function is not your stylist, bestie πŸ™ˆ

πŸ‘‘ RETURN VALUE πŸ‘‘

The explain_mount_or_die function only returns on success, see mount(2) for more information. On failure, prints an explanation and exits, it does not return. it does NOT come back. there is no "after". 😭

The explain_mount_on_error function always returns the value return by the wrapped mount(2) system call. she always comes home 🏠


πŸ“ EXAMPLE πŸ“

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

explain_mount_or_die(source, target, file_systems_type, flags, data);
that's it. that's the whole vibe. call it, and if the mount flops, it screams the reason at you and dips. iconic behaviour honestly πŸ’…

🌈 SEE ALSO 🌈


libexplain version 1.4 Copyright (C) 2013 Peter Miller


aaaand that's the whole page bestie 🫢 this was explain_mount_or_die(3), from libexplain version 1.4, with Copyright (C) 2013 Peter Miller holding it down at the bottom like the queen she is πŸ‘‘ go mount something responsibly, mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from