blob: 4aa74f876a5681d066a594d2141cb5fd75e99934 [file] [log] [blame]
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package memory
import (
"syscall"
)
func total() uint64 {
info := &syscall.Sysinfo_t{}
err := syscall.Sysinfo(info)
if err != nil {
return 0
}
return uint64(info.Totalram) * uint64(info.Unit)
}