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

Function MmapShmpDataV1

fbclock/shmem.go:188–194  ·  view source on GitHub ↗

MmapShmpDataV1 mmaps open file as fbclock shared memory. Used in tests only.

(fd uintptr)

Source from the content-addressed store, hash-verified

186
187// MmapShmpDataV1 mmaps open file as fbclock shared memory. Used in tests only.
188func MmapShmpDataV1(fd uintptr) (unsafe.Pointer, error) {
189 data, err := unix.Mmap(int(fd), 0, C.FBCLOCK_SHMDATA_SIZE, unix.PROT_READ, unix.MAP_SHARED)
190 if err != nil {
191 return nil, err
192 }
193 return unsafe.Pointer(&data[0]), nil
194}
195
196// ReadFBClockData will read Data from mmaped fbclock shared memory. Used in tests only
197func ReadFBClockData(shmp unsafe.Pointer) (*DataV2, error) {

Callers 1

TestDaemonDoWorkFunction · 0.92

Calls

no outgoing calls

Tested by 1

TestDaemonDoWorkFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…