// +build !windows

package bbolt

import 

// mlock locks memory of db file
func mlock( *DB,  int) error {
	 := 
	if  > .datasz {
		// Can't lock more than mmaped slice
		 = .datasz
	}
	if  := unix.Mlock(.dataref[:]);  != nil {
		return 
	}
	return nil
}

//munlock unlocks memory of db file
func munlock( *DB,  int) error {
	if .dataref == nil {
		return nil
	}

	 := 
	if  > .datasz {
		// Can't unlock more than mmaped slice
		 = .datasz
	}

	if  := unix.Munlock(.dataref[:]);  != nil {
		return 
	}
	return nil
}