Fix sysinfo() totalram on XNU

HW_MEMSIZE is the 64-bit version of HW_PHYSMEM, which is inaccurate on
systems having more than 4gb of RAM.
This commit is contained in:
Justine Tunney 2022-12-18 02:10:18 -08:00
parent 0da47c51de
commit 5a3c646307
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
3 changed files with 4 additions and 4 deletions

View file

@ -13,7 +13,8 @@ struct sysinfo {
uint64_t totalswap; /* size of emergency memory */
uint64_t freeswap; /* hopefully equal to totalswap */
int16_t procs; /* number of processes */
int16_t __ignore; /* padding */
int16_t __ignore1; /* padding */
int32_t __ignore2; /* padding */
uint64_t totalhigh; /* wut */
uint64_t freehigh; /* wut */
uint32_t mem_unit; /* ram stuff above is multiples of this */