EXPLAIN_FUTIMESAT_OR_DIE(3)

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

πŸ’– explain_futimesat_or_die(3) πŸ’–

okay bestie, sit down, we're doing a Library Functions Manual moment and honestly? this one is a bop. it's from the libexplain family, she's giving "wrapped syscall but make it chatty", and i'm obsessed. 🫢


✨ NAME ✨

explain_futimesat_or_die β€” change timestamps of a file relative to a directory and report errors

like. the name is the whole personality. it does the thing, and if the thing fails, it tells you why and then dramatically exits. main character energy fr fr. πŸ’…


🌸 SYNOPSIS 🌸

#include <libexplain/futimesat.h>
void explain_futimesat_or_die(int fildes, const char *pathname, const
struct timeval *data);
int explain_futimesat_on_error(int fildes, const char *pathname, const
struct timeval *data);

two functions, two vibes. one of them is a lil dramatic (dies on failure), one of them is chill (comes back and tells you what happened). pick your fighter. πŸ₯Š


πŸ¦‹ DESCRIPTION πŸ¦‹

so, explain_futimesat_or_die is the function you call when you want to call the futimesat(2) system call. and when it fails? no cap, an explanation gets printed to stderr, and that explanation comes straight from the explain_futimesat(3) function. and then, the process terminates by calling exit(EXIT_FAILURE). she said "we're not doing this today" and left. πŸ’€

meanwhile, explain_futimesat_on_error is her calmer sibling. same energy, same call to futimesat(2), same explanation printed to stderr (again obtained from the explain_futimesat(3) function) β€” but instead of exiting, it still returns to the caller. respectful. mature. we love her. 🌈

now, the arguments, because details matter:

  • fildes β€” the fildes, exactly as to be passed to the futimesat(2) system call. no extra seasoning, no notes, pass it through as-is. ✨
  • pathname β€” the pathname, exactly as to be passed to the futimesat(2) system call. same deal, you're just the messenger. πŸŽ€
  • data β€” the data, exactly as to be passed to the futimesat(2) system call. you guessed it, verbatim, character for character. πŸ“

πŸ‘‘ RETURN VALUE πŸ‘‘

  • explain_futimesat_or_die β€” only returns on success, and honestly? check futimesat(2) for more info on that. on failure it prints an explanation and exits, it does not return. like, at all. not even a little. 😭
  • explain_futimesat_on_error β€” always returns the value returned by the wrapped futimesat(2) system call. consistent queen. πŸ’œ

🧚 EXAMPLE 🧚

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

explain_futimesat_or_die(fildes, pathname, data);

that's it. that's the whole glow-up. short, sweet, slays. ⭐


πŸ”₯ SEE ALSO πŸ”₯

go read these if you want the full lore, iykyk. πŸ“š

libexplain version 1.4 Copyright (C) 2013 Peter Miller


okay that's the whole page bestie, you ate, go call your syscalls responsibly πŸŒΈπŸ’… and remember: libexplain version 1.4, Copyright (C) 2013 Peter Miller, and the page is literally called explain_futimesat_or_die(3) β€” periodt. 🫢✨

πŸ“¦ where this page comes from