< prev index next >

src/os/bsd/vm/os_bsd.inline.hpp

Print this page




  78 #endif
  79 }
  80 
  81 
  82 // On Bsd, reservations are made on a page by page basis, nothing to do.
  83 inline void os::pd_split_reserved_memory(char *base, size_t size,
  84                                       size_t split, bool realloc) {
  85 }
  86 
  87 
  88 // Bang the shadow pages if they need to be touched to be mapped.
  89 inline void os::bang_stack_shadow_pages() {
  90 }
  91 
  92 inline void os::dll_unload(void *lib) {
  93   ::dlclose(lib);
  94 }
  95 
  96 inline const int os::default_file_open_flags() { return 0;}
  97 
  98 inline DIR* os::opendir(const char* dirname)
  99 {
 100   assert(dirname != NULL, "just checking");
 101   return ::opendir(dirname);
 102 }
 103 
 104 inline int os::readdir_buf_size(const char *path)
 105 {
 106   return NAME_MAX + sizeof(dirent) + 1;
 107 }
 108 
 109 inline jlong os::lseek(int fd, jlong offset, int whence) {
 110   return (jlong) ::lseek(fd, offset, whence);
 111 }
 112 
 113 inline int os::fsync(int fd) {
 114   return ::fsync(fd);
 115 }
 116 
 117 inline char* os::native_path(char *path) {
 118   return path;
 119 }
 120 
 121 inline int os::ftruncate(int fd, jlong length) {
 122   return ::ftruncate(fd, length);
 123 }
 124 
 125 inline struct dirent* os::readdir(DIR* dirp, dirent *dbuf)
 126 {
 127   dirent* p;
 128   int status;
 129   assert(dirp != NULL, "just checking");
 130 
 131   // NOTE: Bsd readdir_r (on RH 6.2 and 7.2 at least) is NOT like the POSIX
 132   // version. Here is the doc for this function:
 133   // http://www.gnu.org/manual/glibc-2.2.3/html_node/libc_262.html
 134 
 135   if((status = ::readdir_r(dirp, dbuf, &p)) != 0) {
 136     errno = status;
 137     return NULL;
 138   } else
 139     return p;
 140 }
 141 
 142 inline int os::closedir(DIR *dirp) {
 143   assert(dirp != NULL, "argument is NULL");
 144   return ::closedir(dirp);
 145 }
 146 
 147 // macros for restartable system calls
 148 
 149 #define RESTARTABLE(_cmd, _result) do { \
 150     _result = _cmd; \
 151   } while(((int)_result == OS_ERR) && (errno == EINTR))
 152 
 153 #define RESTARTABLE_RETURN_INT(_cmd) do { \
 154   int _result; \
 155   RESTARTABLE(_cmd, _result); \
 156   return _result; \
 157 } while(false)
 158 
 159 inline bool os::numa_has_static_binding()   { return true; }
 160 inline bool os::numa_has_group_homing()     { return false;  }
 161 
 162 inline size_t os::restartable_read(int fd, void *buf, unsigned int nBytes) {
 163   size_t res;
 164   RESTARTABLE( (size_t) ::read(fd, buf, (size_t) nBytes), res);




  78 #endif
  79 }
  80 
  81 
  82 // On Bsd, reservations are made on a page by page basis, nothing to do.
  83 inline void os::pd_split_reserved_memory(char *base, size_t size,
  84                                       size_t split, bool realloc) {
  85 }
  86 
  87 
  88 // Bang the shadow pages if they need to be touched to be mapped.
  89 inline void os::bang_stack_shadow_pages() {
  90 }
  91 
  92 inline void os::dll_unload(void *lib) {
  93   ::dlclose(lib);
  94 }
  95 
  96 inline const int os::default_file_open_flags() { return 0;}
  97 











  98 inline jlong os::lseek(int fd, jlong offset, int whence) {
  99   return (jlong) ::lseek(fd, offset, whence);
 100 }
 101 
 102 inline int os::fsync(int fd) {
 103   return ::fsync(fd);
 104 }
 105 
 106 inline char* os::native_path(char *path) {
 107   return path;
 108 }
 109 
 110 inline int os::ftruncate(int fd, jlong length) {
 111   return ::ftruncate(fd, length);






















 112 }
 113 
 114 // macros for restartable system calls
 115 
 116 #define RESTARTABLE(_cmd, _result) do { \
 117     _result = _cmd; \
 118   } while(((int)_result == OS_ERR) && (errno == EINTR))
 119 
 120 #define RESTARTABLE_RETURN_INT(_cmd) do { \
 121   int _result; \
 122   RESTARTABLE(_cmd, _result); \
 123   return _result; \
 124 } while(false)
 125 
 126 inline bool os::numa_has_static_binding()   { return true; }
 127 inline bool os::numa_has_group_homing()     { return false;  }
 128 
 129 inline size_t os::restartable_read(int fd, void *buf, unsigned int nBytes) {
 130   size_t res;
 131   RESTARTABLE( (size_t) ::read(fd, buf, (size_t) nBytes), res);


< prev index next >