fc81a301b8
Fixes #2119
19 lines
317 B
Go
19 lines
317 B
Go
// +build dragonfly freebsd linux 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)
|
|
}
|