#pragma once #include #include #include namespace voidlibc::loader::linux_handoff { struct LoadResult { void* dl_handle = nullptr; // opaque handle from dlopen std::string error; // empty on success bool ok = false; }; // Take a synthesized ELF DSO buffer, place it in a memfd (or fallback // temp file), and dlopen it. Returns the raw dlopen handle. Callers // own it and must dlclose() it. LoadResult dlopen_buffer(const std::vector& elf_bytes, const char* debug_name = "voidlibc.elf"); // Thin wrappers so the caller never includes . void* sym(void* handle, const char* name); int close_(void* handle); } // namespace voidlibc::loader::linux_handoff