X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fruntime%2Fbsd-os.c;h=6d1679007b29091401a6d9ac0d7cb6958af10c17;hb=17ae4361ba5f4c1062d510f3951b0cc10e0bcd8e;hp=cfd7c31343794519cde76c4f1f0a61242c282007;hpb=768c5a8589e9b48afa2c610331673e90e093ccbe;p=sbcl.git diff --git a/src/runtime/bsd-os.c b/src/runtime/bsd-os.c index cfd7c31..6d16790 100644 --- a/src/runtime/bsd-os.c +++ b/src/runtime/bsd-os.c @@ -406,7 +406,20 @@ os_get_runtime_executable_path() return NULL; return copied_string(path); } -#else /* Not DARWIN or FREEBSD */ +#elif defined(LISP_FEATURE_NETBSD) +char * +os_get_runtime_executable_path() +{ + struct stat sb; + char *path = strdup("/proc/curproc/file"); + if (path && ((stat(path, &sb)) == 0)) + return path; + else { + fprintf(stderr, "Couldn't stat /proc/curproc/file; is /proc mounted?\n"); + return NULL; + } +} +#else /* Not DARWIN or FREEBSD or NETBSD */ char * os_get_runtime_executable_path() {