collector/timex: remove cgo dependency (#1079)

This removes the cgo import from timex collector, as it was only used
to define two constants. Those are part of the Linux kernel<->userspace
interface, thus there is no need to depend on libc to source them:
https://github.com/torvalds/linux/blob/v4.18/include/uapi/linux/timex.h

Signed-off-by: Luca Bruno <luca.bruno@coreos.com>
This commit is contained in:
Luca Bruno 2018-09-20 11:51:34 +02:00 committed by Ben Kochie
parent 6aa5cfba6c
commit 4672ea1671
1 changed files with 7 additions and 7 deletions

View File

@ -16,9 +16,6 @@
package collector package collector
// #include <sys/timex.h>
import "C"
import ( import (
"fmt" "fmt"
"syscall" "syscall"
@ -27,10 +24,13 @@ import (
) )
const ( const (
// The system clock is not synchronized to a reliable server. // The system clock is not synchronized to a reliable
timeError = C.TIME_ERROR // server (TIME_ERROR).
// The timex.Status time resolution bit, 0 = microsecond, 1 = nanoseconds. timeError = 5
staNano = C.STA_NANO // The timex.Status time resolution bit (STA_NANO),
// 0 = microsecond, 1 = nanoseconds.
staNano = 0x2000
// 1 second in // 1 second in
nanoSeconds = 1000000000 nanoSeconds = 1000000000
microSeconds = 1000000 microSeconds = 1000000