< prev index next >

src/hotspot/os/aix/os_aix.inline.hpp

Print this page




  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) {
  89   return (jlong) ::lseek64(fd, offset, whence);
  90 }
  91 
  92 inline int os::fsync(int fd) {
  93   return ::fsync(fd);
  94 }
  95 
  96 inline char* os::native_path(char *path) {
  97   return path;
  98 }
  99 
 100 inline int os::ftruncate(int fd, jlong length) {
 101   return ::ftruncate64(fd, length);
 102 }
 103 
 104 inline struct dirent* os::readdir(DIR* dirp, dirent *dbuf) {
 105   dirent* p = NULL;
 106   assert(dirp != NULL, "just checking");
 107 
 108   // AIX: slightly different from POSIX.
 109   // On AIX, readdir_r returns 0 or != 0 and error details in errno.
 110   if (::readdir_r(dirp, dbuf, &p) != 0) {
 111     return NULL;
 112   }
 113   return p;
 114 }
 115 
 116 inline int os::closedir(DIR *dirp) {
 117   assert(dirp != NULL, "argument is NULL");
 118   return ::closedir(dirp);
 119 }




  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) {
  89   return (jlong) ::lseek64(fd, offset, whence);
  90 }
  91 
  92 inline int os::fsync(int fd) {
  93   return ::fsync(fd);
  94 }
  95 




  96 inline int os::ftruncate(int fd, jlong length) {
  97   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 }


< prev index next >