explain_adjtimex(3)
π explain_adjtimex β Library Functions Manual π
okay bestie, so this is explain_adjtimex from the libexplain library, and it's literally here to explain adjtimex(2) errors to you like a friend who actually gets it π
β¨ NAME β¨
explain_adjtimex β it explains adjtimex(2) errors. that's it, that's the whole job π
πΈ SYNOPSIS πΈ
#include <libexplain/adjtimex.h>
const char *explain_adjtimex(struct timex *data);
const char *explain_errno_adjtimex(int errnum, struct timex *data);
void explain_message_adjtimex(char *message, int message_size, struct
timex *data);
void explain_message_errno_adjtimex(char *message, int message_size, int
errnum, struct timex *data);
π¦ DESCRIPTION π¦
so these functions are the ones you call when adjtimex(2) said no and you need to know why. they give you explanations for errors returned by the adjtimex(2) system call. very demure, very mindful, very "here's what actually went wrong" π«Ά
π explain_adjtimex
const char *explain_adjtimex(struct timex *data);
the explain_adjtimex function is used to obtain an explanation of an error returned by the adjtimex(2) system call. the least the message will contain is the value of strerror(errno), but usually it will do much better than that and tell you the underlying cause in more detail. it's giving overachiever, and we love that for it π
the errno global variable will be used to obtain the error value to be decoded. yes, the real one, the global, no cap.
dataβ the original data, exactly as passed to theadjtimex(2)system call. like, exactly exactly. don't get cute with it.
Returns:
the message explaining the error. this message buffer is shared by all libexplain functions which do not supply a buffer in their argument list. it will be overwritten by the next call to any libexplain function which shares this buffer, including other threads. so like... screenshot it before someone else edits the group chat π
Note: this function is not thread safe, because it shares a return buffer across all threads, and many other functions in this library. periodt. don't say I didn't warn you π
Example: this function is intended to be used in a fashion similar to the following example:
int result = adjtimex(data);
if (result < 0)
{
fprintf(stderr, "%s\n", explain_adjtimex(data));
exit(EXIT_FAILURE);
}
the above code example is available preβpackaged as the explain_adjtimex_or_die(3) function. iconic behaviour, honestly β¨
π explain_errno_adjtimex
const char *explain_errno_adjtimex(int errnum, struct timex *data);
the explain_errno_adjtimex function is used to obtain an explanation of an error returned by the adjtimex(2) system call. the least the message will contain is the value of strerror(errno), but usually it will do much better, and indicate the underlying cause in more detail.
errnumβ the error value to be decoded, usually obtained from theerrnoglobal variable just before this function is called. this is necessary if you need to call any code between the system call to be explained and this function, because many libc functions will alter the value oferrno. so grab it early, bestie, that number does not stay put πdataβ the original data, exactly as passed to theadjtimex(2)system call.
Returns:
the message explaining the error. this message buffer is shared by all libexplain functions which do not supply a buffer in their argument list. this will be overwritten by the next call to any libexplain function which shares this buffer, including other threads.
Note: this function is not thread safe, because it shares a return buffer across all threads, and many other functions in this library. fr fr.
Example: this function is intended to be used in a fashion similar to the following example:
int result = adjtimex(data);
if (result < 0)
{
int err = errno;
fprintf(stderr, "%s\n", explain_errno_adjtimex(err, data));
exit(EXIT_FAILURE);
}
the above code example is available preβpackaged as the explain_adjtimex_or_die(3) function. π
π explain_message_adjtimex
void explain_message_adjtimex(char *message, int message_size, struct
timex *data);
the explain_message_adjtimex function is used to obtain an explanation of an error returned by the adjtimex(2) system call. the least the message will contain is the value of strerror(errno), but usually it will do much better, and indicate the underlying cause in more detail.
the errno global variable will be used to obtain the error value to be decoded.
messageβ the location in which to store the returned message. if a suitable message return buffer is supplied, this function is thread safe. look at you, supplying your own buffer, main character energy πmessage_sizeβ the size in bytes of the location in which to store the returned message.dataβ the original data, exactly as passed to theadjtimex(2)system call.
Example: this function is intended to be used in a fashion similar to the following example:
int result = adjtimex(data);
if (result < 0)
{
char message[3000];
explain_message_adjtimex(message, sizeof(message), data);
fprintf(stderr, "%s\n", message);
exit(EXIT_FAILURE);
}
the above code example is available preβpackaged as the explain_adjtimex_or_die(3) function. πΈ
π explain_message_errno_adjtimex
void explain_message_errno_adjtimex(char *message, int message_size, int
errnum, struct timex *data);
the explain_message_errno_adjtimex function is used to obtain an explanation of an error returned by the adjtimex(2) system call. the least the message will contain is the value of strerror(errno), but usually it will do much better, and indicate the underlying cause in more detail.
messageβ the location in which to store the returned message. if a suitable message return buffer is supplied, this function is thread safe.message_sizeβ the size in bytes of the location in which to store the returned message.errnumβ the error value to be decoded, usually obtained from theerrnoglobal variable just before this function is called. this is necessary if you need to call any code between the system call to be explained and this function, because many libc functions will alter the value oferrno. yeah. same warning as before. it's a whole thing π«dataβ the original data, exactly as passed to theadjtimex(2)system call.
Example: this function is intended to be used in a fashion similar to the following example:
int result = adjtimex(data);
if (result < 0)
{
int err = errno;
char message[3000];
explain_message_errno_adjtimex(message, sizeof(message), err,
data);
fprintf(stderr, "%s\n", message);
exit(EXIT_FAILURE);
}
the above code example is available preβpackaged as the explain_adjtimex_or_die(3) function. slay π
π₯ SEE ALSO π₯
adjtimex(2)β tune kernel clockexplain_adjtimex_or_die(3)β tune kernel clock and report errors
π COPYRIGHT π
libexplainversion1.4- Copyright (C) 2009 Peter Miller
and that's the whole page, bestie π§ libexplain version 1.4, copyright (C) 2009 Peter Miller β mwah, go forth and explain those errors πβ¨π
π¦ where this page comes from
- debian bookworm: libexplain-dev 1.4.D001-12+b1 Β· LGPL-3.0-or-later
- debian trixie: libexplain-dev 1.4.D001-16 Β· LGPL-3.0-or-later
- ubuntu jammy: libexplain-dev 1.4.D001-12 Β· LGPL-3.0-or-later
- ubuntu noble: libexplain-dev 1.4.D001-13 Β· LGPL-3.0-or-later
- ubuntu resolute: libexplain-dev 1.4.D001-16 Β· LGPL-3.0-or-later
- Copyright (C) 2009-2011 Peter Miller
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms