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. */
char *
os_get_runtime_executable_path()
{
- return NULL;
+ int ret;
+ char path[] = "/proc/self/object/a.out";
+
+ ret = access(path, R_OK);
+ if (ret == -1)
+ return NULL;
+
+ return copied_string(path);
}