72 ::dlclose(lib); |
72 ::dlclose(lib); |
73 } |
73 } |
74 |
74 |
75 inline const int os::default_file_open_flags() { return 0;} |
75 inline const int os::default_file_open_flags() { return 0;} |
76 |
76 |
77 inline DIR* os::opendir(const char* dirname) { |
|
78 assert(dirname != NULL, "just checking"); |
|
79 return ::opendir(dirname); |
|
80 } |
|
81 |
|
82 inline int os::readdir_buf_size(const char *path) { |
|
83 // According to aix sys/limits, NAME_MAX must be retrieved at runtime. |
|
84 const long my_NAME_MAX = pathconf(path, _PC_NAME_MAX); |
|
85 return my_NAME_MAX + sizeof(dirent) + 1; |
|
86 } |
|
87 |
|
88 inline jlong os::lseek(int fd, jlong offset, int whence) { |
77 inline jlong os::lseek(int fd, jlong offset, int whence) { |
89 return (jlong) ::lseek64(fd, offset, whence); |
78 return (jlong) ::lseek64(fd, offset, whence); |
90 } |
79 } |
91 |
80 |
92 inline int os::fsync(int fd) { |
81 inline int os::fsync(int fd) { |
93 return ::fsync(fd); |
82 return ::fsync(fd); |
94 } |
83 } |
95 |
84 |
96 inline int os::ftruncate(int fd, jlong length) { |
85 inline int os::ftruncate(int fd, jlong length) { |
97 return ::ftruncate64(fd, length); |
86 return ::ftruncate64(fd, length); |
98 } |
|
99 |
|
100 inline struct dirent* os::readdir(DIR* dirp, dirent *dbuf) { |
|
101 dirent* p = NULL; |
|
102 assert(dirp != NULL, "just checking"); |
|
103 |
|
104 // AIX: slightly different from POSIX. |
|
105 // On AIX, readdir_r returns 0 or != 0 and error details in errno. |
|
106 if (::readdir_r(dirp, dbuf, &p) != 0) { |
|
107 return NULL; |
|
108 } |
|
109 return p; |
|
110 } |
|
111 |
|
112 inline int os::closedir(DIR *dirp) { |
|
113 assert(dirp != NULL, "argument is NULL"); |
|
114 return ::closedir(dirp); |
|
115 } |
87 } |
116 |
88 |
117 // macros for restartable system calls |
89 // macros for restartable system calls |
118 |
90 |
119 #define RESTARTABLE(_cmd, _result) do { \ |
91 #define RESTARTABLE(_cmd, _result) do { \ |