mirror of https://github.com/tinygo-org/tinygo.git
Dan Kegel
3 years ago
committed by
Ron Evans
2 changed files with 43 additions and 0 deletions
@ -0,0 +1,23 @@ |
|||
// 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.
|
|||
|
|||
//go:build darwin || linux
|
|||
// +build darwin linux
|
|||
|
|||
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) |
|||
} |
|||
} |
Loading…
Reference in new issue