X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fsunos-os.c;h=0cccfe167418905020a10cabcfccce4362e19b48;hb=03363f0145ab5e88a17a4b881068dc921f7d122f;hp=723534f2ead36c3cf52c06551c017ad45271c7ea;hpb=b27fb452f72190637b03a6ef2e1333091da42a98;p=sbcl.git diff --git a/src/runtime/sunos-os.c b/src/runtime/sunos-os.c index 723534f..0cccfe1 100644 --- a/src/runtime/sunos-os.c +++ b/src/runtime/sunos-os.c @@ -66,19 +66,18 @@ os_init(char *argv[], char *envp[]) lose("sunos major version=%d (which isn't 5!)\n", major_version); } minor_version = atoi(name.release+2); - if ((minor_version == 8) || - (minor_version == 9) || - (minor_version == 10)) { - KLUDGE_MAYBE_MAP_ANON = 0x100; - } else if (minor_version > 10) { - FSHOW((stderr, "os_init: Solaris version greater than 9?\nUnknown MAP_ANON behaviour.\n")); - lose("Unknown mmap() interaction with MAP_ANON\n"); - } else { /* minor_version < 8 */ + if ((minor_version < 8)) { kludge_mmap_fd = open("/dev/zero",O_RDONLY); if (kludge_mmap_fd < 0) { perror("open"); lose("Error in open(..)\n"); } + } else if (minor_version > 11) { + FSHOW((stderr, "os_init: Solaris version greater than 11?\nUnknown MAP_ANON behaviour.\n")); + lose("Unknown mmap() interaction with MAP_ANON\n"); + } else { + /* Versions 8-11*/ + KLUDGE_MAYBE_MAP_ANON = 0x100; } /* I do not understand this at all. FIXME. */ @@ -241,3 +240,16 @@ os_install_interrupt_handlers() undoably_install_low_level_interrupt_handler(SIG_MEMORY_FAULT, sigsegv_handler); } + +char * +os_get_runtime_executable_path() +{ + int ret; + char path[] = "/proc/self/object/a.out"; + + ret = access(path, R_OK); + if (ret == -1) + return NULL; + + return copied_string(path); +}