< prev index next >
src/hotspot/os/linux/os_linux.inline.hpp
Print this page
@@ -94,32 +94,21 @@
inline int os::ftruncate(int fd, jlong length) {
return ::ftruncate64(fd, length);
}
-inline struct dirent* os::readdir(DIR* dirp, dirent *dbuf)
+inline struct dirent* os::readdir(DIR* dirp)
{
-// readdir_r has been deprecated since glibc 2.24.
-// See https://sourceware.org/bugzilla/show_bug.cgi?id=19056 for more details.
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-
dirent* p;
- int status;
assert(dirp != NULL, "just checking");
- // NOTE: Linux readdir_r (on RH 6.2 and 7.2 at least) is NOT like the POSIX
- // version. Here is the doc for this function:
- // http://www.gnu.org/manual/glibc-2.2.3/html_node/libc_262.html
-
- if((status = ::readdir_r(dirp, dbuf, &p)) != 0) {
- errno = status;
- return NULL;
- } else
+ p = ::readdir(dirp);
+ if (errno == 0) {
return p;
-
-#pragma GCC diagnostic pop
+ } else {
+ return NULL;
+ }
}
inline int os::closedir(DIR *dirp) {
assert(dirp != NULL, "argument is NULL");
return ::closedir(dirp);
< prev index next >