The Linux, Solaris, BSD, and AIX implementations of os::lasterror are identical, and could be replaced with a single os_posix implementation.
A related question is whether we really need os::lasterror at all. The only non-Windows code that calls it is metaspaceShared.cpp, in two places. Both of those places are in response to an fopen call that failed, so nothing platform-specific about that, since fopen is a standard C function that is defined to set errno to indicate the error. So both of these calls to os::lasterror could be replaced with calls to strerror(errno).
A related question is whether we really need os::lasterror at all. The only non-Windows code that calls it is metaspaceShared.cpp, in two places. Both of those places are in response to an fopen call that failed, so nothing platform-specific about that, since fopen is a standard C function that is defined to set errno to indicate the error. So both of these calls to os::lasterror could be replaced with calls to strerror(errno).
- relates to
-
JDK-7015652 src/os/solaris, src/os/linux and src/os/bsd should not contain duplicate code
-
- Closed
-