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 aix darwin dragonfly freebsd linux netbsd openbsd
14 func TestMmap(t
*testing
.T
) {
15 b
, err
:= syscall
.Mmap(-1, 0, syscall
.Getpagesize(), syscall
.PROT_NONE
, syscall
.MAP_ANON|syscall
.MAP_PRIVATE
)
17 t
.Fatalf("Mmap: %v", err
)
19 if err
:= syscall
.Munmap(b
); err
!= nil {
20 t
.Fatalf("Munmap: %v", err
)