* new feature: new SAVE-LISP-AND-DIE keyword argument :EXECUTABLE can
be used for bundling the runtime and the core file into one
executable binary. This feature is not currently supported on all SBCL
- platforms. (thanks to James Bielman)
+ platforms. (thanks to James Bielman and NIIMI Satoshi)
* minor incompatible change: the method by which SBCL finds its
contributed modules has changed; it no longer relies on symbolic
links from an $SBCL_HOME/systems directory, but searches directly
}
#endif
-#ifndef LISP_FEATURE_DARWIN /* defined in ppc-darwin-os.c instead */
+#ifdef LISP_FEATURE_DARWIN
+/* defined in ppc-darwin-os.c instead */
+#elif defined(LISP_FEATURE_FREEBSD)
+char *
+os_get_runtime_executable_path()
+{
+ char path[PATH_MAX + 1];
+ /* Defined on FreeBSD 6 and later. -- JES, 2006-02-06. */
+#ifdef KERN_PROC_PATHNAME
+ size_t len = PATH_MAX + 1;
+ int mib[4];
+
+ mib[0] = CTL_KERN;
+ mib[1] = KERN_PROC;
+ mib[2] = KERN_PROC_PATHNAME;
+ mib[3] = -1;
+ if (sysctl(mib, 4, &path, &len, NULL, 0) != 0)
+ /* FIXME: Should we rather fall back into the /proc/-based
+ * code below, so that an SBCL executable core made on
+ * FreeBSD 6 would have at least some chance of working on
+ * FreeBSD 4? -- JES, 2006-02-06.
+ */
+ return NULL;
+#else
+ int size;
+ size = readlink("/proc/curproc/file", path, sizeof(path) - 1);
+ if (size < 0)
+ return NULL;
+ path[size] = '\0';
+ if (strcmp(path, "unknown") == 0)
+ return NULL;
+#endif
+ return copied_string(path);
+}
+#else /* Not DARWIN or FREEBSD */
char *
os_get_runtime_executable_path()
{
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.9.9.12"
+"0.9.9.13"