79 80 inline DIR* os::opendir(const char* dirname) 81 { 82 assert(dirname != NULL, "just checking"); 83 return ::opendir(dirname); 84 } 85 86 inline int os::readdir_buf_size(const char *path) 87 { 88 return NAME_MAX + sizeof(dirent) + 1; 89 } 90 91 inline jlong os::lseek(int fd, jlong offset, int whence) { 92 return (jlong) ::lseek(fd, offset, whence); 93 } 94 95 inline int os::fsync(int fd) { 96 return ::fsync(fd); 97 } 98 99 inline char* os::native_path(char *path) { 100 return path; 101 } 102 103 inline int os::ftruncate(int fd, jlong length) { 104 return ::ftruncate(fd, length); 105 } 106 107 inline struct dirent* os::readdir(DIR* dirp, dirent *dbuf) 108 { 109 dirent* p; 110 int status; 111 assert(dirp != NULL, "just checking"); 112 113 // NOTE: Bsd readdir_r (on RH 6.2 and 7.2 at least) is NOT like the POSIX 114 // version. Here is the doc for this function: 115 // http://www.gnu.org/manual/glibc-2.2.3/html_node/libc_262.html 116 117 if((status = ::readdir_r(dirp, dbuf, &p)) != 0) { 118 errno = status; 119 return NULL; 120 } else 121 return p; 122 } | 79 80 inline DIR* os::opendir(const char* dirname) 81 { 82 assert(dirname != NULL, "just checking"); 83 return ::opendir(dirname); 84 } 85 86 inline int os::readdir_buf_size(const char *path) 87 { 88 return NAME_MAX + sizeof(dirent) + 1; 89 } 90 91 inline jlong os::lseek(int fd, jlong offset, int whence) { 92 return (jlong) ::lseek(fd, offset, whence); 93 } 94 95 inline int os::fsync(int fd) { 96 return ::fsync(fd); 97 } 98 99 inline int os::ftruncate(int fd, jlong length) { 100 return ::ftruncate(fd, length); 101 } 102 103 inline struct dirent* os::readdir(DIR* dirp, dirent *dbuf) 104 { 105 dirent* p; 106 int status; 107 assert(dirp != NULL, "just checking"); 108 109 // NOTE: Bsd readdir_r (on RH 6.2 and 7.2 at least) is NOT like the POSIX 110 // version. Here is the doc for this function: 111 // http://www.gnu.org/manual/glibc-2.2.3/html_node/libc_262.html 112 113 if((status = ::readdir_r(dirp, dbuf, &p)) != 0) { 114 errno = status; 115 return NULL; 116 } else 117 return p; 118 } |