distribution/packages/sysutils/wait-time-sync/sources/wait-time-sync.c
2022-02-05 09:23:32 -05:00

23 lines
365 B
C

/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright (C) 2020-present Team LibreELEC (https://libreelec.tv) */
#include <sys/timex.h>
#include <unistd.h>
#include <errno.h>
int main()
{
int rc;
for (;;)
{
struct timex tx = {};
rc = adjtimex(&tx);
if (rc != TIME_ERROR)
break;
usleep(1000000U/3);
}
return rc == -1 ? errno : 0;
}