mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-25 20:10:29 +00:00
Clean up some code
This commit is contained in:
parent
ec3275179f
commit
285c565051
33 changed files with 122 additions and 382 deletions
|
@ -21,6 +21,7 @@
|
|||
#include "libc/nt/accounting.h"
|
||||
#include "libc/nt/struct/memorystatusex.h"
|
||||
#include "libc/nt/struct/systeminfo.h"
|
||||
#include "libc/nt/synchronization.h"
|
||||
#include "libc/nt/systeminfo.h"
|
||||
|
||||
textwindows int sys_sysinfo_nt(struct sysinfo *info) {
|
||||
|
@ -29,10 +30,11 @@ textwindows int sys_sysinfo_nt(struct sysinfo *info) {
|
|||
GetSystemInfo(&sysinfo);
|
||||
memstat.dwLength = sizeof(struct NtMemoryStatusEx);
|
||||
if (GlobalMemoryStatusEx(&memstat)) {
|
||||
info->mem_unit = 1;
|
||||
info->totalram = memstat.ullTotalPhys;
|
||||
info->freeram = memstat.ullAvailPhys;
|
||||
info->procs = sysinfo.dwNumberOfProcessors;
|
||||
info->mem_unit = 1;
|
||||
info->uptime = GetTickCount64() / 1000;
|
||||
return 0;
|
||||
} else {
|
||||
return __winerr();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue