This repository was archived by the owner on Jan 1, 2022. It is now read-only.

Description
t.c
#include <stdio.h>
#include <sys/timex.h>
int main(int argc, char *argv[]) {
struct timex txc = {};
int ret = adjtimex(&txc);
fprintf(stdout, "adjtimex, ret=%d, STA_UNSYNC=%d, TIME_OK=%d, TIME_ERROR=%d\n", ret, (txc.status & STA_UNSYNC),
(ret==TIME_OK),
(ret==TIME_ERROR));
return 0;
}
sudo ./htpdate -t -a -d <URL> -s -x
adjtimex, ret=5, STA_UNSYNC=64, TIME_OK=0, TIME_ERROR=1
http://linuxelf.com/blog/2017/03/27/clock-status-unsync/