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

Function fbclock_clockdata_store_data

fbclock/fbclock.c:87–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85 return 0;
86 }
87 return strncmp(str + lenstr - lensuffix, suffix, lensuffix) == 0;
88}
89
90int fbclock_clockdata_store_data(uint32_t fd, fbclock_clockdata* data) {
91 fbclock_shmdata* shmp = mmap(
92 NULL, FBCLOCK_SHMDATA_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
93 if (shmp == MAP_FAILED) {
94 return FBCLOCK_E_SHMEM_MAP_FAILED;
95 }
96 uint64_t crc = fbclock_clockdata_crc(data);
97 memcpy(&shmp->data, data, FBCLOCK_CLOCKDATA_SIZE);
98 atomic_store(&shmp->crc, crc);
99 munmap(shmp, FBCLOCK_SHMDATA_SIZE);
100 return FBCLOCK_E_NO_ERROR;
101}

Callers 2

TESTFunction · 0.85
writer_threadFunction · 0.85

Calls 1

fbclock_clockdata_crcFunction · 0.85

Tested by 2

TESTFunction · 0.68
writer_threadFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…