| 1 |
// Copyright 2024 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. |
| 4 |
|
| 5 |
package unix_test |
| 6 |
|
| 7 |
import ( |
| 8 |
"internal/syscall/unix" |
| 9 |
"syscall" |
| 10 |
"testing" |
| 11 |
) |
| 12 |
|
| 13 |
func TestSupportCopyFileRange(t *testing.T) { |
| 14 |
major, minor := unix.KernelVersion() |
| 15 |
t.Logf("Running on FreeBSD %d.%d\n", major, minor) |
| 16 |
|
| 17 |
_, err := unix.CopyFileRange(0, nil, 0, nil, 0, 0) |
| 18 |
want := err != syscall.ENOSYS |
| 19 |
got := unix.SupportCopyFileRange() |
| 20 |
if want != got { |
| 21 |
t.Fatalf("SupportCopyFileRange, got %t; want %t", got, want) |
| 22 |
} |
| 23 |
} |