54 55 inline bool os::allocate_stack_guard_pages() { 56 assert(uses_stack_guard_pages(), "sanity check"); 57 int r = thr_main() ; 58 guarantee (r == 0 || r == 1, "CR6501650 or CR6493689") ; 59 return r; 60 } 61 62 63 // On Solaris, reservations are made on a page by page basis, nothing to do. 64 inline void os::pd_split_reserved_memory(char *base, size_t size, 65 size_t split, bool realloc) { 66 } 67 68 69 // Bang the shadow pages if they need to be touched to be mapped. 70 inline void os::bang_stack_shadow_pages() { 71 } 72 inline void os::dll_unload(void *lib) { ::dlclose(lib); } 73 74 inline DIR* os::opendir(const char* dirname) { 75 assert(dirname != NULL, "just checking"); 76 return ::opendir(dirname); 77 } 78 79 inline int os::readdir_buf_size(const char *path) { 80 int size = pathconf(path, _PC_NAME_MAX); 81 return (size < 0 ? MAXPATHLEN : size) + sizeof(dirent) + 1; 82 } 83 84 inline struct dirent* os::readdir(DIR* dirp, dirent* dbuf) { 85 assert(dirp != NULL, "just checking"); 86 #if defined(_LP64) || defined(_GNU_SOURCE) || _FILE_OFFSET_BITS==64 87 dirent* p; 88 int status; 89 90 if((status = ::readdir_r(dirp, dbuf, &p)) != 0) { 91 errno = status; 92 return NULL; 93 } else 94 return p; 95 #else // defined(_LP64) || defined(_GNU_SOURCE) || _FILE_OFFSET_BITS==64 96 return ::readdir_r(dirp, dbuf); 97 #endif // defined(_LP64) || defined(_GNU_SOURCE) || _FILE_OFFSET_BITS==64 98 } 99 100 inline int os::closedir(DIR *dirp) { 101 assert(dirp != NULL, "argument is NULL"); 102 return ::closedir(dirp); 103 } 104 105 ////////////////////////////////////////////////////////////////////////////// 106 //////////////////////////////////////////////////////////////////////////////// 107 108 // macros for interruptible io and system calls and system call restarting 109 110 #define _INTERRUPTIBLE(_setup, _cmd, _result, _thread, _clear, _before, _after, _int_enable) \ 111 do { \ 112 _setup; \ 113 _before; \ 114 OSThread* _osthread = _thread->osthread(); \ 115 if (_int_enable && _thread->has_last_Java_frame()) { \ 116 /* this is java interruptible io stuff */ \ 117 if (os::is_interrupted(_thread, _clear)) { \ 118 os::Solaris::bump_interrupted_before_count(); \ 119 _result = OS_INTRPT; \ 120 } else { \ 121 /* _cmd always expands to an assignment to _result */ \ 122 if ((_cmd) < 0 && errno == EINTR \ 123 && os::is_interrupted(_thread, _clear)) { \ 124 os::Solaris::bump_interrupted_during_count(); \ | 54 55 inline bool os::allocate_stack_guard_pages() { 56 assert(uses_stack_guard_pages(), "sanity check"); 57 int r = thr_main() ; 58 guarantee (r == 0 || r == 1, "CR6501650 or CR6493689") ; 59 return r; 60 } 61 62 63 // On Solaris, reservations are made on a page by page basis, nothing to do. 64 inline void os::pd_split_reserved_memory(char *base, size_t size, 65 size_t split, bool realloc) { 66 } 67 68 69 // Bang the shadow pages if they need to be touched to be mapped. 70 inline void os::bang_stack_shadow_pages() { 71 } 72 inline void os::dll_unload(void *lib) { ::dlclose(lib); } 73 74 ////////////////////////////////////////////////////////////////////////////// 75 //////////////////////////////////////////////////////////////////////////////// 76 77 // macros for interruptible io and system calls and system call restarting 78 79 #define _INTERRUPTIBLE(_setup, _cmd, _result, _thread, _clear, _before, _after, _int_enable) \ 80 do { \ 81 _setup; \ 82 _before; \ 83 OSThread* _osthread = _thread->osthread(); \ 84 if (_int_enable && _thread->has_last_Java_frame()) { \ 85 /* this is java interruptible io stuff */ \ 86 if (os::is_interrupted(_thread, _clear)) { \ 87 os::Solaris::bump_interrupted_before_count(); \ 88 _result = OS_INTRPT; \ 89 } else { \ 90 /* _cmd always expands to an assignment to _result */ \ 91 if ((_cmd) < 0 && errno == EINTR \ 92 && os::is_interrupted(_thread, _clear)) { \ 93 os::Solaris::bump_interrupted_during_count(); \ |