EXPLAIN_UTIMENSAT_OR_DIE(3)

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

πŸ’– explain_utimensat_or_die(3) πŸ’–

okay bestie, sit down, hydrate, because we're talking about explain_utimensat_or_die(3) from the Library Functions Manual. this is the girl who changes your file timestamps and then, if things go sideways, tells you exactly why before she dramatically exits the group chat. πŸ’…


✨ NAME ✨

explain_utimensat_or_die β€” change file timestamps and report errors


🌸 SYNOPSIS 🌸

#include <libexplain/utimensat.h>
void explain_utimensat_or_die(int fildes, const char *pathname, const struct timespec *data, int flags);
int explain_utimensat_on_error(int fildes, const char *pathname, const struct timespec *data, int flags);

like. two functions. one of them is the dramatic one and one of them is the chill one. we love a duo. 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

so the explain_utimensat_or_die function is literally just here to call the utimensat(2) system call for you. that's the job. that's the whole vibe.

but here's the tea β˜• β€” if it fails, it prints an explanation to stderr (obtained from the explain_utimensat(3) function, she's the source of all the gossip), and then the process terminates by calling exit(EXIT_FAILURE). like, no survivors. it's giving main character exit. πŸ’€

meanwhile explain_utimensat_on_error is the same deal β€” it also calls the utimensat(2) system call, and on failure it also prints an explanation to stderr, also obtained from the explain_utimensat(3) function β€” but she's emotionally stable and still returns to the caller. no exiting. no drama. just information. ✨

and now the arguments, one by one, no skipping, we don't do that here:

  • fildes β€” the fildes, exactly as to be passed to the utimensat(2) system call. literally exactly. don't get creative with it bestie.
  • pathname β€” the pathname, exactly as to be passed to the utimensat(2) system call. same energy, same rule.
  • data β€” the data, exactly as to be passed to the utimensat(2) system call. yes, still exactly.
  • flags β€” the flags, exactly as to be passed to the utimensat(2) system call. you already know the rule by now. πŸŽ€

πŸ”₯ RETURN VALUE πŸ”₯

explain_utimensat_or_die only ever returns on success β€” and if you wanna know more about what success looks like, go read utimensat(2), she explains it better. on failure? it prints an explanation and exits. it does not return. not ever. not even a little. 😭

explain_utimensat_on_error always returns the value returned by the wrapped utimensat(2) system call. always. she's consistent like that. πŸ‘‘


🌈 EXAMPLE 🌈

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

explain_utimensat_or_die(fildes, pathname, data, flags);

that's it. that's the example. iconic, honestly. no notes. ⭐


πŸ’œ SEE ALSO πŸ’œ

go read all three, bestie, they're all bangers. iykyk. 🌸


libexplain version 1.4

Copyright (C) 2012 Peter Miller


and that's the whole page, we ate and left no crumbs πŸ’… this was explain_utimensat_or_die(3) β€” libexplain version 1.4, copyright (C) 2012 Peter Miller β€” signing off, mwah πŸ«Άβœ¨πŸ’–

πŸ“¦ where this page comes from