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

Function OpenFBClockShmCustomVer

fbclock/shmem_notlinux.go:67–82  ·  view source on GitHub ↗

OpenFBClockShmCustomVer returns opened POSIX shared mem used by fbclock

(path string, version int)

Source from the content-addressed store, hash-verified

65
66// OpenFBClockShmCustomVer returns opened POSIX shared mem used by fbclock
67func OpenFBClockShmCustomVer(path string, version int) (*Shm, error) {
68 shm, err := OpenShm(path, os.O_CREATE|os.O_RDWR, 0o644)
69 if err != nil {
70 return nil, err
71 }
72 size := int64(shmDataSize)
73 if version == 2 {
74 size = int64(shmDataV2Size)
75 }
76 if err := shm.File.Truncate(size); err != nil {
77 shm.Close()
78 return nil, err
79 }
80 shm.Version = version
81 return shm, nil
82}
83
84// OpenFBClockSHM returns opened POSIX shared mem used by fbclock
85func OpenFBClockSHM() (*Shm, error) {

Callers 3

TestDaemonDoWorkFunction · 0.92
OpenFBClockShmCustomFunction · 0.70
OpenFBClockSHMv2Function · 0.70

Calls 2

OpenShmFunction · 0.70
CloseMethod · 0.65

Tested by 1

TestDaemonDoWorkFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…