timex

package
v0.12.0-alpha.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2021 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package timex provides a simple wrapper around adjtimex syscall.

Index

Constants

View Source
const (
	ADJ_OFFSET    = 0x0001
	ADJ_FREQUENCY = 0x0002
	ADJ_MAXERROR  = 0x0004
	ADJ_ESTERROR  = 0x0008
	ADJ_STATUS    = 0x0010
	ADJ_TIMECONST = 0x0020
	ADJ_TAI       = 0x0080
	ADJ_SETOFFSET = 0x0100
	ADJ_MICRO     = 0x1000
	ADJ_NANO      = 0x2000
	ADJ_TICK      = 0x4000
)

Values for timex.mode.

View Source
const (
	STA_PLL       = 0x0001 /* enable PLL updates (rw) */
	STA_PPSFREQ   = 0x0002 /* enable PPS freq discipline (rw) */
	STA_PPSTIME   = 0x0004 /* enable PPS time discipline (rw) */
	STA_FLL       = 0x0008 /* select frequency-lock mode (rw) */
	STA_INS       = 0x0010 /* insert leap (rw) */
	STA_DEL       = 0x0020 /* delete leap (rw) */
	STA_UNSYNC    = 0x0040 /* clock unsynchronized (rw) */
	STA_FREQHOLD  = 0x0080 /* hold frequency (rw) */
	STA_PPSSIGNAL = 0x0100 /* PPS signal present (ro) */
	STA_PPSJITTER = 0x0200 /* PPS signal jitter exceeded (ro) */
	STA_PPSWANDER = 0x0400 /* PPS signal wander exceeded (ro) */
	STA_PPSERROR  = 0x0800 /* PPS signal calibration error (ro) */
	STA_CLOCKERR  = 0x1000 /* clock hardware fault (ro) */
	STA_NANO      = 0x2000 /* resolution (0 = us, 1 = ns) (ro) */
	STA_MODE      = 0x4000 /* mode (0 = PLL, 1 = FLL) (ro) */
	STA_CLK       = 0x8000 /* clock source (0 = A, 1 = B) (ro) */
)

Clock statuses.

Variables

This section is empty.

Functions

This section is empty.

Types

type State

type State int

State is clock state.

const (
	TIME_OK State = iota
	TIME_INS
	TIME_DEL
	TIME_OOP
	TIME_WAIT
	TIME_ERROR
)

Clock states.

func Adjtimex

func Adjtimex(buf *syscall.Timex) (state State, err error)

Adjtimex provides a wrapper around syscall.Adjtimex.

func (State) String

func (state State) String() string

type Status

type Status int32

Status is bitmask field of statuses.

func (Status) String

func (status Status) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL