Commit f9b384f5 authored by Dave Cheney's avatar Dave Cheney

syscall: fix solaris build

Solaris does not define syscall.{Mmap,Munmap}. Move the Mmap test to a new file and exclude solaris as discussed.

LGTM=aram
R=aram, mikioh.mikioh, iant
CC=golang-codereviews
https://golang.org/cl/68720043
parent 391002a8
// 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.
// +build darwin dragonfly freebsd linux netbsd openbsd
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)
}
}
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build freebsd dragonfly darwin linux netbsd openbsd solaris
// +build darwin dragonfly freebsd linux netbsd openbsd solaris
package syscall_test
......@@ -77,16 +77,6 @@ func TestFcntlFlock(t *testing.T) {
}
}
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)
}
}
// TestPassFD tests passing a file descriptor over a Unix socket.
//
// This test involved both a parent and child process. The parent
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment