mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-25 05:45:11 +02:00
8074895: os::getenv is inadequate
Reviewed-by: dholmes, coleenp
This commit is contained in:
parent
67e0ba13c0
commit
0353353bde
11 changed files with 106 additions and 141 deletions
|
@ -184,20 +184,6 @@ julong os::physical_memory() {
|
|||
return Linux::physical_memory();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// environment support
|
||||
|
||||
bool os::getenv(const char* name, char* buf, int len) {
|
||||
const char* val = ::getenv(name);
|
||||
if (val != NULL && strlen(val) < (size_t)len) {
|
||||
strcpy(buf, val);
|
||||
return true;
|
||||
}
|
||||
if (len > 0) buf[0] = 0; // return a null string
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// Return true if user is running as root.
|
||||
|
||||
bool os::have_special_privileges() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue