distribution/packages/sysutils/wait-time-sync/sources/wait-time-sync.c

24 lines
365 B
C
Raw Normal View History

2022-02-05 14:23:32 +00:00
/* 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;
}