X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fwin32-os.c;h=8ec02db4e86877fcbffdca9ef2dd70e57aa8f83a;hb=1363121ddb1d2e722e2e41d1c93758551066797c;hp=a867faff562620ff4745023a2eb62e8af799569d;hpb=0d48b1acdac8ebca4d3afd02e651c89ef676d922;p=sbcl.git diff --git a/src/runtime/win32-os.c b/src/runtime/win32-os.c index a867faf..8ec02db 100644 --- a/src/runtime/win32-os.c +++ b/src/runtime/win32-os.c @@ -38,6 +38,7 @@ #include "interrupt.h" #include "interr.h" #include "lispregs.h" +#include "runtime.h" #include "monitor.h" #include "alloc.h" #include "genesis/primitive-objects.h" @@ -635,4 +636,19 @@ void scratch(void) Sleep(0); } +char * +os_get_runtime_executable_path() +{ + char path[MAX_PATH + 1]; + DWORD bufsize = sizeof(path); + DWORD size; + + if ((size = GetModuleFileNameA(NULL, path, bufsize)) == 0) + return NULL; + else if (size == bufsize && GetLastError() == ERROR_INSUFFICIENT_BUFFER) + return NULL; + + return copied_string(path); +} + /* EOF */