Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions calnex/verify/checks/ping_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
//go:build !race
// +build !race

/*
Copyright (c) Facebook, Inc. and its affiliates.

Expand Down
35 changes: 0 additions & 35 deletions clock/clock_386.go

This file was deleted.

35 changes: 0 additions & 35 deletions clock/clock_64bit.go

This file was deleted.

14 changes: 9 additions & 5 deletions clock/clock_64bit_darwin.go → clock/clock_setters.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//go:build darwin && !386

/*
Copyright (c) Facebook, Inc. and its affiliates.

Expand All @@ -24,11 +22,17 @@ import (
"github.com/facebook/time/phc/unix"
)

type timexInt interface{ ~int32 | ~int64 }

func setTimexField[T timexInt](field *T, val float64) {
*field = T(val)
}

func setFreq(tx *unix.Timex, freqPPB float64) {
tx.Freq = int64(freqPPB * PPBToTimexPPM)
setTimexField(&tx.Freq, freqPPB*PPBToTimexPPM)
}

func setTime(tx *unix.Timex, sec, usec time.Duration) {
tx.Time.Sec = int64(sec)
tx.Time.Usec = int32(usec)
setTimexField(&tx.Time.Sec, float64(sec))
setTimexField(&tx.Time.Usec, float64(usec))
}
2 changes: 1 addition & 1 deletion cmd/ntpcheck/cmd/utils_track.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"fmt"
"time"

"github.com/facebook/time/phc/unix"
"github.com/spf13/cobra"
"golang.org/x/sys/unix"
)

func getRawMonotonic() float64 {
Expand Down
46 changes: 0 additions & 46 deletions ntp/responder/server/server_darwin_test.go

This file was deleted.

83 changes: 0 additions & 83 deletions ntp/responder/server/server_freebsd.go

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !linux

/*
Copyright (c) Facebook, Inc. and its affiliates.

Expand Down Expand Up @@ -76,7 +78,7 @@ func deleteIfaceIP(iface *net.Interface, addr *net.IP) error {
}

// PHCOffset periodically checks for PHC-SYS offset and updates it in the config
// PHC reading is not supported on Darwin
// PHC reading is not supported on this platform
func phcOffset(_ string) (time.Duration, error) {
return 0, nil
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !linux

/*
Copyright (c) Facebook, Inc. and its affiliates.

Expand Down
1 change: 1 addition & 0 deletions phc/unix/linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ const (
SYS_CLOCK_SETTIME = unix.SYS_CLOCK_SETTIME //nolint:revive
TIME_OK = unix.TIME_OK //nolint:revive
CLOCK_BOOTTIME = unix.CLOCK_BOOTTIME //nolint:revive
CLOCK_MONOTONIC_RAW = unix.CLOCK_MONOTONIC_RAW //nolint:revive
)

var (
Expand Down
6 changes: 4 additions & 2 deletions phc/unix/notlinux.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ type Timex struct {
// Linux-only constants that need stub values on Darwin
//
//nolint:revive
//nolint:revive
const (
TIME_OK = 0
CLOCK_BOOTTIME = 7
TIME_OK = 0
CLOCK_BOOTTIME = 7
CLOCK_MONOTONIC_RAW = 4
)

// FdToClockID is not supported on non-linux.
Expand Down
11 changes: 5 additions & 6 deletions phc/unix/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,9 @@ const (
POLLPRI = unix.POLLPRI
SizeofPtr = unix.SizeofPtr
SizeofSockaddrInet4 = unix.SizeofSockaddrInet4
SOCK_DGRAM = unix.SOCK_DGRAM //nolint:revive
SOL_SOCKET = unix.SOL_SOCKET //nolint:revive
SO_RCVTIMEO = unix.SO_RCVTIMEO //nolint:revive
SO_TIMESTAMP = unix.SO_TIMESTAMP //nolint:revive
CLOCK_REALTIME = unix.CLOCK_REALTIME //nolint:revive
CLOCK_MONOTONIC_RAW = unix.CLOCK_MONOTONIC_RAW //nolint:revive
SOCK_DGRAM = unix.SOCK_DGRAM //nolint:revive
SOL_SOCKET = unix.SOL_SOCKET //nolint:revive
SO_RCVTIMEO = unix.SO_RCVTIMEO //nolint:revive
SO_TIMESTAMP = unix.SO_TIMESTAMP //nolint:revive
CLOCK_REALTIME = unix.CLOCK_REALTIME //nolint:revive
)
92 changes: 0 additions & 92 deletions timestamp/timestamp_freebsd.go

This file was deleted.

Loading
Loading