src/hotspot/os/linux/os_linux.cpp
changeset 50930 6a5f1195e15f
parent 50667 cc58f1fa0438
child 50956 429b0997c16d
equal deleted inserted replaced
50929:ef57cfcd22ff 50930:6a5f1195e15f
  1417 // Die immediately, no exit hook, no abort hook, no cleanup.
  1417 // Die immediately, no exit hook, no abort hook, no cleanup.
  1418 void os::die() {
  1418 void os::die() {
  1419   ::abort();
  1419   ::abort();
  1420 }
  1420 }
  1421 
  1421 
  1422 
       
  1423 // This method is a copy of JDK's sysGetLastErrorString
       
  1424 // from src/solaris/hpi/src/system_md.c
       
  1425 
       
  1426 size_t os::lasterror(char *buf, size_t len) {
       
  1427   if (errno == 0)  return 0;
       
  1428 
       
  1429   const char *s = os::strerror(errno);
       
  1430   size_t n = ::strlen(s);
       
  1431   if (n >= len) {
       
  1432     n = len - 1;
       
  1433   }
       
  1434   ::strncpy(buf, s, n);
       
  1435   buf[n] = '\0';
       
  1436   return n;
       
  1437 }
       
  1438 
       
  1439 // thread_id is kernel thread id (similar to Solaris LWP id)
  1422 // thread_id is kernel thread id (similar to Solaris LWP id)
  1440 intx os::current_thread_id() { return os::Linux::gettid(); }
  1423 intx os::current_thread_id() { return os::Linux::gettid(); }
  1441 int os::current_process_id() {
  1424 int os::current_process_id() {
  1442   return ::getpid();
  1425   return ::getpid();
  1443 }
  1426 }