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 22:29:28 +00:00
committed by Gopher Robot
parent 01b330b26f
commit 6938dae65e
2 changed files with 70 additions and 0 deletions
+35
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