72 } 73 74 75 // Bang the shadow pages if they need to be touched to be mapped. 76 inline void os::bang_stack_shadow_pages() { 77 } 78 inline void os::dll_unload(void *lib) { ::dlclose(lib); } 79 80 inline DIR* os::opendir(const char* dirname) { 81 assert(dirname != NULL, "just checking"); 82 return ::opendir(dirname); 83 } 84 85 inline int os::readdir_buf_size(const char *path) { 86 int size = pathconf(path, _PC_NAME_MAX); 87 return (size < 0 ? MAXPATHLEN : size) + sizeof(dirent) + 1; 88 } 89 90 inline struct dirent* os::readdir(DIR* dirp, dirent* dbuf) { 91 assert(dirp != NULL, "just checking"); 92 #if defined(_LP64) || defined(_GNU_SOURCE) 93 dirent* p; 94 int status; 95 96 if((status = ::readdir_r(dirp, dbuf, &p)) != 0) { 97 errno = status; 98 return NULL; 99 } else 100 return p; 101 #else // defined(_LP64) || defined(_GNU_SOURCE) 102 return ::readdir_r(dirp, dbuf); 103 #endif // defined(_LP64) || defined(_GNU_SOURCE) 104 } 105 106 inline int os::closedir(DIR *dirp) { 107 assert(dirp != NULL, "argument is NULL"); 108 return ::closedir(dirp); 109 } 110 111 ////////////////////////////////////////////////////////////////////////////// 112 //////////////////////////////////////////////////////////////////////////////// 113 114 // macros for interruptible io and system calls and system call restarting 115 116 #define _INTERRUPTIBLE(_setup, _cmd, _result, _thread, _clear, _before, _after, _int_enable) \ 117 do { \ 118 _setup; \ 119 _before; \ 120 OSThread* _osthread = _thread->osthread(); \ 121 if (_int_enable && _thread->has_last_Java_frame()) { \ 122 /* this is java interruptible io stuff */ \ 123 if (os::is_interrupted(_thread, _clear)) { \ | 72 } 73 74 75 // Bang the shadow pages if they need to be touched to be mapped. 76 inline void os::bang_stack_shadow_pages() { 77 } 78 inline void os::dll_unload(void *lib) { ::dlclose(lib); } 79 80 inline DIR* os::opendir(const char* dirname) { 81 assert(dirname != NULL, "just checking"); 82 return ::opendir(dirname); 83 } 84 85 inline int os::readdir_buf_size(const char *path) { 86 int size = pathconf(path, _PC_NAME_MAX); 87 return (size < 0 ? MAXPATHLEN : size) + sizeof(dirent) + 1; 88 } 89 90 inline struct dirent* os::readdir(DIR* dirp, dirent* dbuf) { 91 assert(dirp != NULL, "just checking"); 92 #if defined(_LP64) || defined(_GNU_SOURCE) || _FILE_OFFSET_BITS==64 93 dirent* p; 94 int status; 95 96 if((status = ::readdir_r(dirp, dbuf, &p)) != 0) { 97 errno = status; 98 return NULL; 99 } else 100 return p; 101 #else // defined(_LP64) || defined(_GNU_SOURCE) || _FILE_OFFSET_BITS==64 102 return ::readdir_r(dirp, dbuf); 103 #endif // defined(_LP64) || defined(_GNU_SOURCE) || _FILE_OFFSET_BITS==64 104 } 105 106 inline int os::closedir(DIR *dirp) { 107 assert(dirp != NULL, "argument is NULL"); 108 return ::closedir(dirp); 109 } 110 111 ////////////////////////////////////////////////////////////////////////////// 112 //////////////////////////////////////////////////////////////////////////////// 113 114 // macros for interruptible io and system calls and system call restarting 115 116 #define _INTERRUPTIBLE(_setup, _cmd, _result, _thread, _clear, _before, _after, _int_enable) \ 117 do { \ 118 _setup; \ 119 _before; \ 120 OSThread* _osthread = _thread->osthread(); \ 121 if (_int_enable && _thread->has_last_Java_frame()) { \ 122 /* this is java interruptible io stuff */ \ 123 if (os::is_interrupted(_thread, _clear)) { \ |