mirror of
				https://github.com/optim-enterprises-bv/vault.git
				synced 2025-11-03 20:17:59 +00:00 
			
		
		
		
	[helper] support mlock on Solaris/SmartOS
This commit is contained in:
		
							
								
								
									
										17
									
								
								helper/mlock/mlock_solaris.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								helper/mlock/mlock_solaris.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,17 @@
 | 
			
		||||
// +build 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)
 | 
			
		||||
}
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
// +build windows plan9 darwin freebsd openbsd solaris
 | 
			
		||||
// +build windows plan9 darwin freebsd openbsd
 | 
			
		||||
 | 
			
		||||
package mlock
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user