* fhandler_proc.cc (format_proc_uptime): Don't call GetSystemInfo.
Fetch CPU count from wincap. (format_proc_stat): Ditto. * globals.cc (system_info): Move to wincap. * heap.cc (heap_init): Fetch page size from wincap. * syscalls.cc (getpagesize): Fetch allocation granularity from wincap. (getsystempagesize): Fetch page size from wincap. * wincap.cc (wincap_2003): Default is_server to false. (wincapc::init): Call GetSystemInfo here. Always set is_server value. * wincap.h (class wincapc): Add system_info as private member. (wincapc::cpu_count): New public method. (wincapc::page_size): Ditto. (wincapc::allocation_granularity): Ditto.
This commit is contained in:
@@ -181,7 +181,7 @@ wincaps wincap_xpsp2 __attribute__((section (".cygwin_dll_common"), shared)) = {
|
||||
wincaps wincap_2003 __attribute__((section (".cygwin_dll_common"), shared)) = {
|
||||
heapslop:0x4,
|
||||
max_sys_priv:SE_CREATE_GLOBAL_PRIVILEGE,
|
||||
is_server:true,
|
||||
is_server:false,
|
||||
has_physical_mem_access:false,
|
||||
has_create_global_privilege:true,
|
||||
has_ioctl_storage_get_media_types_ex:true,
|
||||
@@ -279,6 +279,7 @@ wincapc::init ()
|
||||
if (caps)
|
||||
return; // already initialized
|
||||
|
||||
GetSystemInfo (&system_info);
|
||||
memset (&version, 0, sizeof version);
|
||||
version.dwOSVersionInfoSize = sizeof (OSVERSIONINFOEX);
|
||||
if (!GetVersionEx (reinterpret_cast<LPOSVERSIONINFO>(&version)))
|
||||
@@ -347,8 +348,7 @@ wincapc::init ()
|
||||
break;
|
||||
}
|
||||
|
||||
if (version.wProductType != VER_NT_WORKSTATION)
|
||||
((wincaps *)caps)->is_server = true;
|
||||
((wincaps *)caps)->is_server = (version.wProductType != VER_NT_WORKSTATION);
|
||||
if (NT_SUCCESS (NtQueryInformationProcess (NtCurrentProcess (),
|
||||
ProcessWow64Information,
|
||||
&wow64, sizeof wow64, NULL))
|
||||
|
Reference in New Issue
Block a user