JDK-8074895 : os::getenv is inadequate
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2015-03-10
  • Updated: 2022-06-15
  • Resolved: 2015-03-31
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 9
9 b64Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Description
os::getenv takes a buffer, and returns false in two cases: 1) if there was no environment variable, and 2) if the environment variable didn't fit into the buffer.

This makes it impossible to use this API to get the entire contents of the environment variable - you are limited to the length of the buffer.

Straight getenv() itself is part of the C99 spec, and supported on all platforms for which we build Hotspot.  The only platform we know that doesn't support it is WinRT, and Hotspot doesn't target WinRT.
Comments
URL: http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/f5dbba218597 User: lana Date: 2015-05-13 21:19:48 +0000
13-05-2015

URL: http://hg.openjdk.java.net/jdk9/hs-rt/hotspot/rev/f5dbba218597 User: dholmes Date: 2015-03-31 02:08:49 +0000
31-03-2015