mirror of
https://github.com/rwinkhart/sys.git
synced 2026-09-05 08:37:31 -04:00
unix: add Mremap for netbsd
Fixes golang/go#60409 Change-Id: I2d872a1a6fb63c27ab3753deff370e1c2f752bdd Reviewed-on: https://go-review.googlesource.com/c/sys/+/508397 Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com> Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Benny Siegert <bsiegert@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
This commit is contained in:
committed by
Gopher Robot
parent
a1a9c4b846
commit
3fead03e7d
+5
-5
@@ -2,8 +2,8 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build linux
|
||||
// +build linux
|
||||
//go:build linux || netbsd
|
||||
// +build linux netbsd
|
||||
|
||||
package unix_test
|
||||
|
||||
@@ -24,7 +24,7 @@ func TestMremap(t *testing.T) {
|
||||
|
||||
b[0] = 42
|
||||
|
||||
bNew, err := unix.Mremap(b, unix.Getpagesize()*2, unix.MREMAP_MAYMOVE)
|
||||
bNew, err := unix.Mremap(b, unix.Getpagesize()*2, unix.MremapMaymove)
|
||||
if err != nil {
|
||||
t.Fatalf("Mremap2: %v", err)
|
||||
}
|
||||
@@ -40,8 +40,8 @@ func TestMremap(t *testing.T) {
|
||||
t.Fatal("new memory cap not equal to specified len")
|
||||
}
|
||||
|
||||
_, err = unix.Mremap(b, unix.Getpagesize(), unix.MREMAP_FIXED)
|
||||
_, err = unix.Mremap(b, unix.Getpagesize(), unix.MremapFixed)
|
||||
if err != unix.EINVAL {
|
||||
t.Fatalf("unix.MREMAP_FIXED should be forbidden")
|
||||
t.Fatalf("remapping to a fixed address; got %v, want %v", err, unix.EINVAL)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user