2016-12-09 09:00:14 +00:00
|
|
|
// +build !windows,!plan9,!solaris
|
|
|
|
|
|
|
|
package tsdb
|
|
|
|
|
2016-12-11 14:49:36 +00:00
|
|
|
import (
|
|
|
|
"os"
|
2017-04-04 13:59:52 +00:00
|
|
|
"syscall"
|
2016-12-11 14:49:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func mmap(f *os.File, length int) ([]byte, error) {
|
2017-04-04 13:59:52 +00:00
|
|
|
return syscall.Mmap(int(f.Fd()), 0, length, syscall.PROT_READ, syscall.MAP_SHARED)
|
2016-12-11 14:49:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func munmap(b []byte) (err error) {
|
2017-04-04 13:59:52 +00:00
|
|
|
return syscall.Munmap(b)
|
2016-12-11 14:49:36 +00:00
|
|
|
}
|