explain_futimens_or_die(3)

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

πŸ’… explain_futimens_or_die β€” Library Functions Manual πŸ’…

okay bestie, sit down, hydrate, and let me tell you about explain_futimens_or_die(3) 🫢


✨ NAME ✨

explain_futimens_or_die β€” change file timestamps and report errors πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

#include <libexplain/futimens.h>
void explain_futimens_or_die(int fildes, const struct time_spec *data);
int explain_futimens_on_error(int fildes, const struct time_spec *data);

🌸 DESCRIPTION 🌸

okay so, explain_futimens_or_die is the function you call when you want to call the futimens(3) system call, except you're not in the mood to be left confused when it goes wrong. πŸ¦‹

If it fails, an explanation gets printed to stderr, and that explanation comes from the explain_futimens(3) function. Then the process terminates by calling exit(EXIT_FAILURE). yeah. it really said "we're done here." πŸ’€

Meanwhile, explain_futimens_on_error is the softer sibling 🧚 β€” it also calls the futimens(3) system call, and on failure it also prints an explanation to stderr obtained from explain_futimens(3), but it still returns to the caller instead of nuking your whole process. lowkey the responsible one.

  • fildes β€” the fildes, exactly as to be passed to the futimens(3) system call. no editing, no vibes-based remixing, just pass it through. ✨
  • data β€” the data, exactly as to be passed to the futimens(3) system call. same energy. πŸ’œ

πŸ‘‘ RETURN VALUE πŸ‘‘

explain_futimens_or_die only returns on success β€” see futimens(3) for more info, bestie. On failure, it prints an explanation and exits, so like… it does not return. at all. it's giving "no notes, goodbye." πŸ’…

explain_futimens_on_error always returns the value returned by the wrapped futimens(3) system call. periodt. 🌟


🌈 EXAMPLE 🌈

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

explain_futimens_or_die(fildes, data);

that's it, that's the whole thing, and it ate. πŸ”₯


πŸ“ SEE ALSO πŸ“


libexplain version 1.4 Copyright (C) 2013 Peter Miller


and that's the whole page bestie!! πŸŽ€ thanks for reading all the way to the bottom, you're literally the main character. mwah. πŸ’…βœ¨πŸ¦‹

libexplain version 1.4 Β· Copyright (C) 2013 Peter Miller Β· explain_futimens_or_die(3)

πŸ“¦ where this page comes from