Codebase list golang-github-oschwald-maxminddb-golang / upstream/1.2.0 mmap_unix.go
upstream/1.2.0

Tree @upstream/1.2.0 (Download .tar.gz)

mmap_unix.go @upstream/1.2.0raw · history · blame

// +build !windows,!appengine

package maxminddb

import (
	"syscall"

	"golang.org/x/sys/unix"
)

func mmap(fd int, length int) (data []byte, err error) {
	return unix.Mmap(fd, 0, length, syscall.PROT_READ, syscall.MAP_SHARED)
}

func munmap(b []byte) (err error) {
	return unix.Munmap(b)
}