Skip to content

Instantly share code, notes, and snippets.

@vcgomes
Created March 3, 2020 17:50
Show Gist options
  • Save vcgomes/1193214edd0311b6cb924b53fdcc80b3 to your computer and use it in GitHub Desktop.
Save vcgomes/1193214edd0311b6cb924b53fdcc80b3 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
#include <sys/timex.h>
#define TAI_OFFSET 37
int main(void)
{
struct timex timex = {
.modes = ADJ_TAI,
.constant = TAI_OFFSET
};
if (adjtimex(&timex) == -1) {
perror("adjtimex failed to set CLOCK_TAI offset");
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment