mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-17 01:24:33 +02:00
8202353: os::readdir should use readdir instead of readdir_r
8202835: jfr/event/os/TestSystemProcess.java fails on missing events Os::readdir uses POSIX readdir, drop buffer arg, fix JFR uses. Reviewed-by: coleenp, tschatzl, bsrbnd
This commit is contained in:
parent
f4723253b6
commit
9a9c824ece
22 changed files with 54 additions and 238 deletions
|
@ -77,17 +77,6 @@ inline void os::dll_unload(void *lib) {
|
|||
|
||||
inline const int os::default_file_open_flags() { return 0;}
|
||||
|
||||
inline DIR* os::opendir(const char* dirname)
|
||||
{
|
||||
assert(dirname != NULL, "just checking");
|
||||
return ::opendir(dirname);
|
||||
}
|
||||
|
||||
inline int os::readdir_buf_size(const char *path)
|
||||
{
|
||||
return NAME_MAX + sizeof(dirent) + 1;
|
||||
}
|
||||
|
||||
inline jlong os::lseek(int fd, jlong offset, int whence) {
|
||||
return (jlong) ::lseek(fd, offset, whence);
|
||||
}
|
||||
|
@ -100,28 +89,6 @@ inline int os::ftruncate(int fd, jlong length) {
|
|||
return ::ftruncate(fd, length);
|
||||
}
|
||||
|
||||
inline struct dirent* os::readdir(DIR* dirp, dirent *dbuf)
|
||||
{
|
||||
dirent* p;
|
||||
int status;
|
||||
assert(dirp != NULL, "just checking");
|
||||
|
||||
// NOTE: Bsd 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
|
||||
return p;
|
||||
}
|
||||
|
||||
inline int os::closedir(DIR *dirp) {
|
||||
assert(dirp != NULL, "argument is NULL");
|
||||
return ::closedir(dirp);
|
||||
}
|
||||
|
||||
// macros for restartable system calls
|
||||
|
||||
#define RESTARTABLE(_cmd, _result) do { \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue