Add memunit to sysinfo(2).

Also properly add padding after Procs in the linux.Sysinfo
structure. This will be implicitly padded to 64bits so we
need to do the same.

PiperOrigin-RevId: 216372907
Change-Id: I6eb6a27800da61d8f7b7b6e87bf0391a48fdb475
This commit is contained in:
Brian Geffon 2018-10-09 09:51:01 -07:00 committed by Shentubot
parent ae5122eb87
commit acf7a95189
2 changed files with 2 additions and 0 deletions

View File

@ -31,6 +31,7 @@ type Sysinfo struct {
TotalSwap uint64
FreeSwap uint64
Procs uint16
_ [6]byte // Pad Procs to 64bits.
TotalHigh uint64
FreeHigh uint64
Unit uint32

View File

@ -36,6 +36,7 @@ func Sysinfo(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.Sysca
Uptime: t.Kernel().MonotonicClock().Now().Seconds(),
TotalRAM: totalSize,
FreeRAM: totalSize - totalUsage,
Unit: 1,
}
_, err := t.CopyOut(addr, si)
return 0, nil, err