explain_adjtimex_or_die(3)

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

πŸ’– explain_adjtimex_or_die(3) πŸ’–

okay bestie, listen β€” this one lives in the Library Functions Manual and it's literally the glow-up wrapper for the adjtimex(2) syscall. she tunes your kernel clock AND drags errors into the light. no cap. πŸ‘‘


✨ NAME ✨

explain_adjtimex_or_die β€” tune kernel clock and report errors πŸ•°οΈπŸ’…


🌸 SYNOPSIS 🌸

#include <libexplain/adjtimex.h>
int explain_adjtimex_or_die(struct timex *data);
int explain_adjtimex_on_error(struct timex *data);

πŸ¦‹ DESCRIPTION πŸ¦‹

so the explain_adjtimex_or_die function is the main character here β€” she calls the adjtimex(2) system call for you. and if it fails?? she prints an explanation to stderr, sourced straight from explain_adjtimex(3), and then she ends the whole process by calling exit(EXIT_FAILURE). it's giving dramatic exit, but make it correct. πŸ’€

the explain_adjtimex_on_error function also calls the adjtimex(2) system call. when it fails, it prints an explanation to stderr too β€” also obtained from explain_adjtimex(3) β€” but she's chill about it and still returns to the caller. no quitting, just vibes. 🫢

  • data β€” the data, exactly as to be passed to the adjtimex(2) system call. literally pass it through untouched, don't be weird about it. ✨

🌈 RETURN VALUE 🌈

explain_adjtimex_or_die only returns on success β€” peep adjtimex(2) for more info. on failure, she prints an explanation and exits, so like… she does not return. periodt.

explain_adjtimex_on_error always returns the value returned by the wrapped adjtimex(2) system call. always. fr fr.


πŸŽ€ EXAMPLE πŸŽ€

the explain_adjtimex_or_die function is meant to be used in a fashion similar to this:

int result = explain_adjtimex_or_die(data);

iconic behavior honestly πŸ“


πŸ”₯ SEE ALSO πŸ”₯


libexplain version 1.4 Copyright (C) 2009 Peter Miller


and that's the whole page bestie, tysm for reading πŸ§šπŸ’œ β€” this was explain_adjtimex_or_die(3), brought to you by the Library Functions Manual, stay slaying ✨

πŸ“¦ where this page comes from