PR go/83787
[official-gcc.git] / libgo / go / syscall / mmap_unix_test.go
blobd0b3644b59cb25992b432f3f3de02d37419b4d35
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
7 package syscall_test
9 import (
10 "syscall"
11 "testing"
14 func TestMmap(t *testing.T) {
15 b, err := syscall.Mmap(-1, 0, syscall.Getpagesize(), syscall.PROT_NONE, syscall.MAP_ANON|syscall.MAP_PRIVATE)
16 if err != nil {
17 t.Fatalf("Mmap: %v", err)
19 if err := syscall.Munmap(b); err != nil {
20 t.Fatalf("Munmap: %v", err)