mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-18 01:54:47 +02:00
8134538: Duplicate implementations of os::lasterror
Method os::lasterror was moved to os_posix.cpp Reviewed-by: hseigel, kbarrett, coleenp
This commit is contained in:
parent
c0ebf80159
commit
209071d135
5 changed files with 13 additions and 66 deletions
|
@ -1419,23 +1419,6 @@ void os::die() {
|
|||
::abort();
|
||||
}
|
||||
|
||||
|
||||
// This method is a copy of JDK's sysGetLastErrorString
|
||||
// from src/solaris/hpi/src/system_md.c
|
||||
|
||||
size_t os::lasterror(char *buf, size_t len) {
|
||||
if (errno == 0) return 0;
|
||||
|
||||
const char *s = os::strerror(errno);
|
||||
size_t n = ::strlen(s);
|
||||
if (n >= len) {
|
||||
n = len - 1;
|
||||
}
|
||||
::strncpy(buf, s, n);
|
||||
buf[n] = '\0';
|
||||
return n;
|
||||
}
|
||||
|
||||
// thread_id is kernel thread id (similar to Solaris LWP id)
|
||||
intx os::current_thread_id() { return os::Linux::gettid(); }
|
||||
int os::current_process_id() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue