explain_adjtime_or_die(3)

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

πŸ’– explain_adjtime_or_die(3) πŸ’–

okay so bestie, welcome to the Library Functions Manual β€” this is the page for explain_adjtime_or_die, and trust, it's giving "smoothly tune kernel clock and report errors" energy. no cap. ✨


🌸 NAME 🌸

explain_adjtime_or_die β€” smoothly tune kernel clock and report errors πŸ•°οΈβœ¨


πŸŽ€ SYNOPSIS πŸŽ€

#include <libexplain/adjtime.h>
void explain_adjtime_or_die(const struct timeval *delta, struct timeval
*olddelta);
int explain_adjtime_on_error(const struct timeval *delta, struct timeval
*olddelta);

like. two functions. one header. so demure. 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

so the explain_adjtime_or_die function is what you call when you wanna hit up the adjtime(2) system call. and if it fails?? an explanation gets printed to stderr β€” obtained from the explain_adjtime(3) function β€” and then the process literally terminates by calling exit(EXIT_FAILURE). it said bye for real. πŸ’€

and then the explain_adjtime_on_error function also calls the adjtime(2) system call, and on failure an explanation is also printed to stderr (again from explain_adjtime(3)), except this one is chill and still returns to the caller. no dramatic exit. main character but emotionally stable. 😌

  • delta β€” the delta, exactly as to be passed to the adjtime(2) system call. exactly. as-is. no edits, no notes. πŸ’…
  • olddelta β€” the olddelta, exactly as to be passed to the adjtime(2) system call. same vibe, same rule. πŸ“

⭐ RETURN VALUE ⭐

the explain_adjtime_or_die function only returns on success β€” peep adjtime(2) for more info. on failure it prints an explanation and exits, so like… it does not return. it's not coming back. it left the group chat. 😭

the explain_adjtime_on_error function, though? it always returns the value returned by the wrapped adjtime(2) system call. every time. reliable queen. πŸ‘‘


🌈 EXAMPLE 🌈

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

explain_adjtime_or_die(delta, olddelta);

that's it. that's the whole example. short, sweet, iconic. πŸ“


πŸ‘‘ SEE ALSO πŸ‘‘


libexplain version 1.4 Copyright (C) 2009 Peter Miller


and that's the tea, bestie πŸŽ€ this was explain_adjtime_or_die(3) from the Library Functions Manual, libexplain version 1.4, Copyright (C) 2009 Peter Miller β€” go tune that kernel clock, you absolute icon πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from