mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-19 14:55:17 +00:00
8273815: move have_special_privileges to os_posix for POSIX platforms
Reviewed-by: mdoerr, stuefe, dholmes
This commit is contained in:
parent
7c9868c0b3
commit
dc7f452acb
@ -267,18 +267,6 @@ julong os::physical_memory() {
|
||||
return Aix::physical_memory();
|
||||
}
|
||||
|
||||
// Return true if user is running as root.
|
||||
|
||||
bool os::have_special_privileges() {
|
||||
static bool init = false;
|
||||
static bool privileges = false;
|
||||
if (!init) {
|
||||
privileges = (getuid() != geteuid()) || (getgid() != getegid());
|
||||
init = true;
|
||||
}
|
||||
return privileges;
|
||||
}
|
||||
|
||||
// Helper function, emulates disclaim64 using multiple 32bit disclaims
|
||||
// because we cannot use disclaim64() on AS/400 and old AIX releases.
|
||||
static bool my_disclaim64(char* addr, size_t size) {
|
||||
|
||||
@ -179,20 +179,6 @@ julong os::physical_memory() {
|
||||
return Bsd::physical_memory();
|
||||
}
|
||||
|
||||
// Return true if user is running as root.
|
||||
|
||||
bool os::have_special_privileges() {
|
||||
static bool init = false;
|
||||
static bool privileges = false;
|
||||
if (!init) {
|
||||
privileges = (getuid() != geteuid()) || (getgid() != getegid());
|
||||
init = true;
|
||||
}
|
||||
return privileges;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Cpu architecture string
|
||||
#if defined(ZERO)
|
||||
static char cpu_arch[] = ZERO_LIBARCH;
|
||||
|
||||
@ -308,19 +308,6 @@ bool os::Linux::get_tick_information(CPUPerfTicks* pticks, int which_logical_cpu
|
||||
return true;
|
||||
}
|
||||
|
||||
// Return true if user is running as root.
|
||||
|
||||
bool os::have_special_privileges() {
|
||||
static bool init = false;
|
||||
static bool privileges = false;
|
||||
if (!init) {
|
||||
privileges = (getuid() != geteuid()) || (getgid() != getegid());
|
||||
init = true;
|
||||
}
|
||||
return privileges;
|
||||
}
|
||||
|
||||
|
||||
#ifndef SYS_gettid
|
||||
// i386: 224, ia64: 1105, amd64: 186, sparc: 143
|
||||
#ifdef __ia64__
|
||||
|
||||
@ -177,6 +177,12 @@ size_t os::lasterror(char *buf, size_t len) {
|
||||
return n;
|
||||
}
|
||||
|
||||
// Return true if user is running as root.
|
||||
bool os::have_special_privileges() {
|
||||
static bool privileges = (getuid() != geteuid()) || (getgid() != getegid());
|
||||
return privileges;
|
||||
}
|
||||
|
||||
void os::wait_for_keypress_at_exit(void) {
|
||||
// don't do anything on posix platforms
|
||||
return;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user