Fix some win32 definitions

You can now use psapi.dll and pdh.dll. Some TODOs for Windows have been
cleared out. We might have a working load average for the platform that
should help GNU Make work well.
This commit is contained in:
Justine Tunney 2022-03-22 19:51:27 -07:00
parent e2e0b042c1
commit c23b6ecc31
162 changed files with 847 additions and 153 deletions

View file

@ -17,6 +17,7 @@
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/calls/internal.h"
#include "libc/calls/loadavg.internal.h"
#include "libc/calls/struct/sysinfo.h"
#include "libc/nt/accounting.h"
#include "libc/nt/struct/memorystatusex.h"
@ -32,6 +33,9 @@ textwindows int sys_sysinfo_nt(struct sysinfo *info) {
info->totalram = memstat.ullTotalPhys;
info->freeram = memstat.ullAvailPhys;
info->procs = sysinfo.dwNumberOfProcessors;
info->loads[0] = __ntloadavg[0] * 65536;
info->loads[1] = __ntloadavg[1] * 65536;
info->loads[2] = __ntloadavg[2] * 65536;
info->mem_unit = 1;
return 0;
} else {