mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-01 18:48:24 -05:00
Bumps [github.com/KimMachineGun/automemlimit](https://github.com/KimMachineGun/automemlimit) from 0.4.0 to 0.5.0. - [Commits](https://github.com/KimMachineGun/automemlimit/compare/v0.4.0...v0.5.0) --- updated-dependencies: - dependency-name: github.com/KimMachineGun/automemlimit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
22 lines
377 B
Go
22 lines
377 B
Go
// +build darwin freebsd openbsd dragonfly netbsd
|
|
|
|
package memory
|
|
|
|
import (
|
|
"syscall"
|
|
"unsafe"
|
|
)
|
|
|
|
func sysctlUint64(name string) (uint64, error) {
|
|
s, err := syscall.Sysctl(name)
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
// hack because the string conversion above drops a \0
|
|
b := []byte(s)
|
|
if len(b) < 8 {
|
|
b = append(b, 0)
|
|
}
|
|
return *(*uint64)(unsafe.Pointer(&b[0])), nil
|
|
}
|