---
name: "explain_adjtime_or_die"
section: "3"
platform: "linux"
package: "libexplain-dev"
version: "1.4.D001-16"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/explain_adjtime_or_die"
---

# explain\_adjtime\_or\_die(3)

smoothly tune kernel clock and report errors

## 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);

## DESCRIPTION

The **explain\_adjtime\_or\_die** function is used to call the [*adjtime*(2)](/adjtime/2.md) system call. On failure an explanation will be printed to *stderr*, obtained from the [*explain\_adjtime*(3)](/explain_adjtime/3.md) function, and then the process terminates by calling `exit(EXIT_FAILURE)`.

The **explain\_adjtime\_on\_error** function is used to call the [*adjtime*(2)](/adjtime/2.md) system call. On failure an explanation will be printed to *stderr*, obtained from the [*explain\_adjtime*(3)](/explain_adjtime/3.md) function, but still returns to the caller.

- *delta*

  The delta, exactly as to be passed to the [*adjtime*(2)](/adjtime/2.md) system call.

- *olddelta*

  The olddelta, exactly as to be passed to the [*adjtime*(2)](/adjtime/2.md) system call.

## RETURN VALUE

The **explain\_adjtime\_or\_die** function only returns on success, see [*adjtime*(2)](/adjtime/2.md) for more information. On failure, prints an explanation and exits, it does not return.

The **explain\_adjtime\_on\_error** function always returns the value return by the wrapped [*adjtime*(2)](/adjtime/2.md) system call.

## 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);
```

## SEE ALSO

- [*adjtime*(2)](/adjtime/2.md)

  smoothly tune kernel clock

- [*explain\_adjtime*(3)](/explain_adjtime/3.md)

  explain [*adjtime*(2)](/adjtime/2.md) errors

- [*exit*(2)](/exit/2.md)

  terminate the calling process

## COPYRIGHT

libexplain version 1.4\
 Copyright (C) 2009 Peter Miller
