mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-16 03:27:01 +02:00
In theory Android and NaCL could build Vault now, too. List of targets derived from: `go tool dist list`
19 lines
331 B
Go
19 lines
331 B
Go
// +build darwin dragonfly freebsd linux netbsd openbsd solaris
|
|
|
|
package mlock
|
|
|
|
import (
|
|
"syscall"
|
|
|
|
"golang.org/x/sys/unix"
|
|
)
|
|
|
|
func init() {
|
|
supported = true
|
|
}
|
|
|
|
func lockMemory() error {
|
|
// Mlockall prevents all current and future pages from being swapped out.
|
|
return unix.Mlockall(syscall.MCL_CURRENT | syscall.MCL_FUTURE)
|
|
}
|