MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / resolve_self_executable

Function resolve_self_executable

src/ui/http_server.c:924–941  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

922}
923
924static bool resolve_self_executable(char *out, size_t outsz) {
925#if defined(__APPLE__)
926 char buf[1024];
927 uint32_t sz = sizeof(buf);
928 if (_NSGetExecutablePath(buf, &sz) == 0 && buf[0]) {
929 return copy_path(out, outsz, buf);
930 }
931 return false;
932#else
933 char buf[1024];
934 ssize_t len = readlink("/proc/self/exe", buf, sizeof(buf) - 1);
935 if (len > 0) {
936 buf[len] = '\0';
937 return copy_path(out, outsz, buf);
938 }
939 return false;
940#endif
941}
942#else
943static bool resolve_self_executable(char *out, size_t outsz) {
944 char *utf8 = cbm_module_path_utf8();

Callers 1

Calls 2

copy_pathFunction · 0.85
cbm_module_path_utf8Function · 0.85

Tested by

no test coverage detected