#pragma once #include #include #include namespace voidlibc::loader::macos_handoff { struct LoadResult { void* dl_handle = nullptr; std::string error; bool ok = false; }; // Write `blob` to a per-process temp file under $TMPDIR and call dlopen on it. // The temp file is unlinked after dlopen succeeds (the mapping keeps the data alive). // Returns a native dlopen handle on success. LoadResult dlopen_buffer(const std::vector& blob); void* sym(void* handle, const char* name); int close_(void* handle); } // namespace voidlibc::loader::macos_handoff