Files
Claude 831e06bd0e Time: follow NTP, NTS and PTP servers, and serve all three
- 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
2026-11-08 15:09:57 +00:00

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 }