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

Function resolve_self_executable

src/ui/http_server.c:908–925  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

906}
907
908static bool resolve_self_executable(char *out, size_t outsz) {
909#if defined(__APPLE__)
910 char buf[1024];
911 uint32_t sz = sizeof(buf);
912 if (_NSGetExecutablePath(buf, &sz) == 0 && buf[0]) {
913 return copy_path(out, outsz, buf);
914 }
915 return false;
916#else
917 char buf[1024];
918 ssize_t len = readlink("/proc/self/exe", buf, sizeof(buf) - 1);
919 if (len > 0) {
920 buf[len] = '\0';
921 return copy_path(out, outsz, buf);
922 }
923 return false;
924#endif
925}
926#else
927static bool resolve_self_executable(char *out, size_t outsz) {
928 char buf[1024];

Callers 1

Calls 1

copy_pathFunction · 0.85

Tested by

no test coverage detected