X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Flinux-os.c;h=345ff482ba3941479cd798b4b909ba602f07eb48;hb=6cb4f9ea3f4e35a5a8e75922833e14575ae92180;hp=2b1dd2522af94fc3ad7efa1ca5c5d0332f0121c5;hpb=a499f2c9099d1dc2cb4227a2505eb4cc6f310e24;p=sbcl.git diff --git a/src/runtime/linux-os.c b/src/runtime/linux-os.c index 2b1dd25..345ff48 100644 --- a/src/runtime/linux-os.c +++ b/src/runtime/linux-os.c @@ -370,3 +370,18 @@ os_install_interrupt_handlers(void) sig_stop_for_gc_handler); #endif } + +char * +os_get_runtime_executable_path() +{ + char path[PATH_MAX + 1]; + int size; + + size = readlink("/proc/self/exe", path, sizeof(path)-1); + if (size < 0) + return NULL; + else + path[size] = '\0'; + + return copied_string(path); +}