JDK-8134538 : Duplicate implementations of os::lasterror
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2015-08-26
  • Updated: 2018-07-06
  • Resolved: 2018-07-03
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 12
12 b01Fixed
Related Reports
Relates :  
Description
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).