< prev index next >

src/hotspot/os/linux/os_linux.inline.hpp

Print this page




  81 }
  82 
  83 inline jlong os::lseek(int fd, jlong offset, int whence) {
  84   return (jlong) ::lseek64(fd, offset, whence);
  85 }
  86 
  87 inline int os::fsync(int fd) {
  88   return ::fsync(fd);
  89 }
  90 
  91 inline char* os::native_path(char *path) {
  92   return path;
  93 }
  94 
  95 inline int os::ftruncate(int fd, jlong length) {
  96   return ::ftruncate64(fd, length);
  97 }
  98 
  99 inline struct dirent* os::readdir(DIR* dirp, dirent *dbuf)
 100 {
 101 // readdir_r has been deprecated since glibc 2.24.
 102 // See https://sourceware.org/bugzilla/show_bug.cgi?id=19056 for more details.
 103 #pragma GCC diagnostic push
 104 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 105 
 106   dirent* p;
 107   int status;
 108   assert(dirp != NULL, "just checking");
 109 
 110   // NOTE: Linux readdir_r (on RH 6.2 and 7.2 at least) is NOT like the POSIX
 111   // version. Here is the doc for this function:
 112   // http://www.gnu.org/manual/glibc-2.2.3/html_node/libc_262.html
 113 
 114   if((status = ::readdir_r(dirp, dbuf, &p)) != 0) {
 115     errno = status;
 116     return NULL;
 117   } else
 118     return p;
 119 
 120 #pragma GCC diagnostic pop
 121 }
 122 
 123 inline int os::closedir(DIR *dirp) {
 124   assert(dirp != NULL, "argument is NULL");
 125   return ::closedir(dirp);
 126 }
 127 
 128 // macros for restartable system calls
 129 
 130 #define RESTARTABLE(_cmd, _result) do { \
 131     _result = _cmd; \
 132   } while(((int)_result == OS_ERR) && (errno == EINTR))
 133 
 134 #define RESTARTABLE_RETURN_INT(_cmd) do { \
 135   int _result; \
 136   RESTARTABLE(_cmd, _result); \
 137   return _result; \
 138 } while(false)
 139 
 140 inline bool os::numa_has_static_binding()   { return true; }




  81 }
  82 
  83 inline jlong os::lseek(int fd, jlong offset, int whence) {
  84   return (jlong) ::lseek64(fd, offset, whence);
  85 }
  86 
  87 inline int os::fsync(int fd) {
  88   return ::fsync(fd);
  89 }
  90 
  91 inline char* os::native_path(char *path) {
  92   return path;
  93 }
  94 
  95 inline int os::ftruncate(int fd, jlong length) {
  96   return ::ftruncate64(fd, length);
  97 }
  98 
  99 inline struct dirent* os::readdir(DIR* dirp, dirent *dbuf)
 100 {







 101   assert(dirp != NULL, "just checking");
 102   return ::readdir(dirp);











 103 }
 104 
 105 inline int os::closedir(DIR *dirp) {
 106   assert(dirp != NULL, "argument is NULL");
 107   return ::closedir(dirp);
 108 }
 109 
 110 // macros for restartable system calls
 111 
 112 #define RESTARTABLE(_cmd, _result) do { \
 113     _result = _cmd; \
 114   } while(((int)_result == OS_ERR) && (errno == EINTR))
 115 
 116 #define RESTARTABLE_RETURN_INT(_cmd) do { \
 117   int _result; \
 118   RESTARTABLE(_cmd, _result); \
 119   return _result; \
 120 } while(false)
 121 
 122 inline bool os::numa_has_static_binding()   { return true; }


< prev index next >