blob: 945f86ea35ec9e0d5a8e40daf28deed1e1bd27e3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
// Copyright (c) Tailscale Inc & contributors
// SPDX-License-Identifier: BSD-3-Clause
//go:build freebsd || openbsd || dragonfly || netbsd
package sysresources
import "golang.org/x/sys/unix"
func totalMemoryImpl() uint64 {
val, err := unix.SysctlUint64("hw.physmem")
if err != nil {
return 0
}
return val
}
|