explain_mount_or_die(3)
β¨ 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 themount(2)system call.targetβ the target, exactly as to be passed to themount(2)system call.file_systems_typeβ the file_systems_type, exactly as to be passed to themount(2)system call.flagsβ the flags, exactly as to be passed to themount(2)system call.dataβ the data, exactly as to be passed to themount(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 π
mount(2)β mount file systemexplain_mount(3)β explainmount(2)errorsexit(2)β terminate the calling process
π COPYRIGHT π
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
- 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) 2013 Peter Miller
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms