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)
| 254 | // whose primary is MONOTONIC_RAW. Separate call from StoreFBClockDataV2 so the |
| 255 | // daemon can publish the primary anchor before the slower REALTIME read. |
| 256 | func 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. |
| 269 | func ReadFBClockDataV2(shmp unsafe.Pointer) (*DataV2, error) { |
no test coverage detected
searching dependent graphs…