MCPcopy Create free account
hub / github.com/facebook/time / StoreFBClockDataRealtime

Function StoreFBClockDataRealtime

fbclock/shmem_notlinux.go:256–266  ·  view source on GitHub ↗

StoreFBClockDataRealtime writes the realtime anchor section, used on hosts whose primary is MONOTONIC_RAW. Separate call from StoreFBClockDataV2 so the daemon can publish the primary anchor before the slower REALTIME read.

(fd uintptr, d DataV2)

Source from the content-addressed store, hash-verified

254// whose primary is MONOTONIC_RAW. Separate call from StoreFBClockDataV2 so the
255// daemon can publish the primary anchor before the slower REALTIME read.
256func StoreFBClockDataRealtime(fd uintptr, d DataV2) error {
257 data, err := unix.Mmap(int(fd), 0, shmDataV2Size, unix.PROT_READ|unix.PROT_WRITE, unix.MAP_SHARED) //nolint:gosec
258 if err != nil {
259 return fmt.Errorf("mmap failed: %w", err)
260 }
261 defer func() { _ = unix.Munmap(data) }()
262
263 return storeSeqlockSection(data, shmV2RealtimeSeqOff, func(buf []byte) {
264 writeClockDataV2(buf, d)
265 })
266}
267
268// ReadFBClockDataV2 reads the primary anchor section. Used in tests only.
269func ReadFBClockDataV2(shmp unsafe.Pointer) (*DataV2, error) {

Callers 1

populateDataV2Method · 0.92

Calls 2

storeSeqlockSectionFunction · 0.85
writeClockDataV2Function · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…