src/hotspot/os/posix/os_posix.cpp
changeset 50930 6a5f1195e15f
parent 50667 cc58f1fa0438
child 51106 f605c91e5219
equal deleted inserted replaced
50929:ef57cfcd22ff 50930:6a5f1195e15f
   148 
   148 
   149 int os::get_last_error() {
   149 int os::get_last_error() {
   150   return errno;
   150   return errno;
   151 }
   151 }
   152 
   152 
       
   153 size_t os::lasterror(char *buf, size_t len) {
       
   154   if (errno == 0)  return 0;
       
   155 
       
   156   const char *s = os::strerror(errno);
       
   157   size_t n = ::strlen(s);
       
   158   if (n >= len) {
       
   159     n = len - 1;
       
   160   }
       
   161   ::strncpy(buf, s, n);
       
   162   buf[n] = '\0';
       
   163   return n;
       
   164 }
       
   165 
   153 bool os::is_debugger_attached() {
   166 bool os::is_debugger_attached() {
   154   // not implemented
   167   // not implemented
   155   return false;
   168   return false;
   156 }
   169 }
   157 
   170