mirror of
https://github.com/D-Modem/bbs.git
synced 2026-11-28 17:38:04 -08:00
- internal/timesync: a clock that follows time servers (the median of their offsets) and can set the system clock; an NTP server with NTS; an NTS-KE server; a PTP grandmaster (multicast, and unicast negotiation) and a PTP client; kernel or network-card timestamps. - [time], [ntp], [nts] and [ptp] sections, the UDP ports bound as root and handed down, and bbs time to ask servers once. - Go 1.26 (facebook/time, the protocols' packets, needs it). - Tested against chrony 4.5 (NTP and NTS, both ways) and linuxptp 4.0 (multicast and unicast, both ways). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B82eRUxvTP6EhwNZTADjqy
23 lines
472 B
Go
23 lines
472 B
Go
//go:build !linux
|
|
|
|
package timesync
|
|
|
|
import (
|
|
"errors"
|
|
"time"
|
|
)
|
|
|
|
type kernel struct {
|
|
synced bool
|
|
maxError time.Duration
|
|
leap uint8
|
|
}
|
|
|
|
// kernelStatus: the system clock is taken to be kept (no adjtimex here).
|
|
func kernelStatus() kernel { return kernel{synced: true} }
|
|
|
|
var errNoSet = errors.New("setting the clock is done on Linux only")
|
|
|
|
func stepClock(time.Duration) error { return errNoSet }
|
|
func slewClock(_, _ time.Duration) error { return errNoSet }
|