Skip to content

Commit

Permalink
unix: add missing constants used with struct Timex on Linux
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Tobias Klauser <[email protected]>
Reviewed-by: Michael Knyszek <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
Reviewed-by: Ian Lance Taylor <[email protected]>
Run-TryBot: Ian Lance Taylor <[email protected]>
Auto-Submit: Ian Lance Taylor <[email protected]>
Auto-Submit: Tobias Klauser <[email protected]>
  • Loading branch information
jclark authored and gopherbot committed Feb 2, 2023
1 parent 01b330b commit 6938dae
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
35 changes: 35 additions & 0 deletions unix/linux/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
35 changes: 35 additions & 0 deletions unix/ztypes_linux.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6938dae

Please sign in to comment.