1 // Copyright 2014 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 // +build darwin dragonfly freebsd linux netbsd openbsd solaris
12 "golang.org/x/sys/unix"
15 func TestMmap(t *testing.T) {
16 b, err := unix.Mmap(-1, 0, unix.Getpagesize(), unix.PROT_NONE, unix.MAP_ANON|unix.MAP_PRIVATE)
18 t.Fatalf("Mmap: %v", err)
20 if err := unix.Munmap(b); err != nil {
21 t.Fatalf("Munmap: %v", err)