mmap_unix.go 274 B

123456789101112131415
  1. // +build !windows,!appengine
  2. package maxminddb
  3. import (
  4. "golang.org/x/sys/unix"
  5. )
  6. func mmap(fd int, length int) (data []byte, err error) {
  7. return unix.Mmap(fd, 0, length, unix.PROT_READ, unix.MAP_SHARED)
  8. }
  9. func munmap(b []byte) (err error) {
  10. return unix.Munmap(b)
  11. }