mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-27 12:05:40 +00:00
17 lines
313 B
Go
17 lines
313 B
Go
|
// Copyright (c) Tailscale Inc & AUTHORS
|
||
|
// 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
|
||
|
}
|