2014-02-25 13:56:41 -07:00
|
|
|
// Copyright 2014 The Go Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
2021-02-19 16:35:10 -07:00
|
|
|
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd
|
2018-09-28 07:29:58 -06:00
|
|
|
// +build aix darwin dragonfly freebsd linux netbsd openbsd
|
2014-02-25 13:56:41 -07:00
|
|
|
|
|
|
|
package syscall_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"syscall"
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestMmap(t *testing.T) {
|
|
|
|
b, err := syscall.Mmap(-1, 0, syscall.Getpagesize(), syscall.PROT_NONE, syscall.MAP_ANON|syscall.MAP_PRIVATE)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("Mmap: %v", err)
|
|
|
|
}
|
|
|
|
if err := syscall.Munmap(b); err != nil {
|
|
|
|
t.Fatalf("Munmap: %v", err)
|
|
|
|
}
|
|
|
|
}
|