diff options
Diffstat (limited to 'vendor/github.com/oschwald/maxminddb-golang/mmap_unix.go')
-rw-r--r-- | vendor/github.com/oschwald/maxminddb-golang/mmap_unix.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/vendor/github.com/oschwald/maxminddb-golang/mmap_unix.go b/vendor/github.com/oschwald/maxminddb-golang/mmap_unix.go new file mode 100644 index 000000000..d898d2570 --- /dev/null +++ b/vendor/github.com/oschwald/maxminddb-golang/mmap_unix.go @@ -0,0 +1,15 @@ +// +build !windows,!appengine + +package maxminddb + +import ( + "golang.org/x/sys/unix" +) + +func mmap(fd int, length int) (data []byte, err error) { + return unix.Mmap(fd, 0, length, unix.PROT_READ, unix.MAP_SHARED) +} + +func munmap(b []byte) (err error) { + return unix.Munmap(b) +} |