master
c 21 lines 410 Bytes
Raw
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 #include "../libnetdata.h"
4
5 #ifdef OS_MACOS
6 #include <AvailabilityMacros.h>
7 #endif
8
9 int os_adjtimex(struct timex *buf __maybe_unused) {
10 #if (defined(OS_MACOS) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 101300)) || \
11 defined(OS_FREEBSD)
12 return ntp_adjtime(buf);
13 #endif
14
15 #if defined(OS_LINUX)
16 return adjtimex(buf);
17 #endif
18
19 errno = ENOSYS;
20 return -1;
21 }