MCPcopy Create free account
hub / github.com/apple/foundationdb / initChain

Function initChain

flow/SignalSafeUnwind.cpp:33–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31 void* data) = nullptr;
32
33static void initChain() {
34 static std::once_flag flag;
35
36 // Ensure that chain_dl_iterate_phdr points to the "real" function that we are overriding
37 std::call_once(flag, []() { *(void**)&chain_dl_iterate_phdr = dlsym(RTLD_NEXT, "dl_iterate_phdr"); });
38
39 if (!chain_dl_iterate_phdr) {
40 criticalError(FDB_EXIT_ERROR, "SignalSafeUnwindError", "Unable to find dl_iterate_phdr symbol");
41 }
42}
43
44// This overrides the function in libc!
45extern "C" int dl_iterate_phdr(int (*callback)(struct dl_phdr_info* info, size_t size, void* data), void* data) {

Callers 1

dl_iterate_phdrFunction · 0.85

Calls 1

criticalErrorFunction · 0.85

Tested by

no test coverage detected