unix: add missing constants used with struct Timex on Linux

This provides definitions for Linux of two groups of constants,
which are used with struct Timex (used with the adjtimex and
clock_adjtime system calls): the ADJ_* constants are used
for the modes field; the STA_* constants are used for the status
field. The constants are documented in the adjtimex(2) man page.

Fixes golang/go#58012

Change-Id: I054f0c40f9cfd9360a0bb10716a08e19584c0fff
Reviewed-on: https://go-review.googlesource.com/c/sys/+/464241
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
This commit is contained in:
James Clark
2023-02-02 17:38:46 +07:00
committed by Gopher Robot
parent 01b330b26f
commit 6938dae65e
2 changed files with 70 additions and 0 deletions

View File

@@ -477,6 +477,41 @@ type ItimerSpec C.struct_itimerspec
type Itimerval C.struct_itimerval
const (
ADJ_OFFSET = C.ADJ_OFFSET
ADJ_FREQUENCY = C.ADJ_FREQUENCY
ADJ_MAXERROR = C.ADJ_MAXERROR
ADJ_ESTERROR = C.ADJ_ESTERROR
ADJ_STATUS = C.ADJ_STATUS
ADJ_TIMECONST = C.ADJ_TIMECONST
ADJ_TAI = C.ADJ_TAI
ADJ_SETOFFSET = C.ADJ_SETOFFSET
ADJ_MICRO = C.ADJ_MICRO
ADJ_NANO = C.ADJ_NANO
ADJ_TICK = C.ADJ_TICK
ADJ_OFFSET_SINGLESHOT = C.ADJ_OFFSET_SINGLESHOT
ADJ_OFFSET_SS_READ = C.ADJ_OFFSET_SS_READ
)
const (
STA_PLL = C.STA_PLL
STA_PPSFREQ = C.STA_PPSFREQ
STA_PPSTIME = C.STA_PPSTIME
STA_FLL = C.STA_FLL
STA_INS = C.STA_INS
STA_DEL = C.STA_DEL
STA_UNSYNC = C.STA_UNSYNC
STA_FREQHOLD = C.STA_FREQHOLD
STA_PPSSIGNAL = C.STA_PPSSIGNAL
STA_PPSJITTER = C.STA_PPSJITTER
STA_PPSWANDER = C.STA_PPSWANDER
STA_PPSERROR = C.STA_PPSERROR
STA_CLOCKERR = C.STA_CLOCKERR
STA_NANO = C.STA_NANO
STA_MODE = C.STA_MODE
STA_CLK = C.STA_CLK
)
const (
TIME_OK = C.TIME_OK
TIME_INS = C.TIME_INS

View File

@@ -29,6 +29,41 @@ type Itimerval struct {
Value Timeval
}
const (
ADJ_OFFSET = 0x1
ADJ_FREQUENCY = 0x2
ADJ_MAXERROR = 0x4
ADJ_ESTERROR = 0x8
ADJ_STATUS = 0x10
ADJ_TIMECONST = 0x20
ADJ_TAI = 0x80
ADJ_SETOFFSET = 0x100
ADJ_MICRO = 0x1000
ADJ_NANO = 0x2000
ADJ_TICK = 0x4000
ADJ_OFFSET_SINGLESHOT = 0x8001
ADJ_OFFSET_SS_READ = 0xa001
)
const (
STA_PLL = 0x1
STA_PPSFREQ = 0x2
STA_PPSTIME = 0x4
STA_FLL = 0x8
STA_INS = 0x10
STA_DEL = 0x20
STA_UNSYNC = 0x40
STA_FREQHOLD = 0x80
STA_PPSSIGNAL = 0x100
STA_PPSJITTER = 0x200
STA_PPSWANDER = 0x400
STA_PPSERROR = 0x800
STA_CLOCKERR = 0x1000
STA_NANO = 0x2000
STA_MODE = 0x4000
STA_CLK = 0x8000
)
const (
TIME_OK = 0x0
TIME_INS = 0x1