mmap_unix.go 292 B

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