aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/nbpipe_fcntl_unix_test.go
diff options
context:
space:
mode:
authorClément Chigot <chigot.c@gmail.com>2019-10-29 15:39:42 +0100
committerIan Lance Taylor <iant@golang.org>2019-10-30 14:51:03 +0000
commitcc4b824e53ef52e1572808c7b7f9b8507516c816 (patch)
tree219e60336bba926405c734552456484c73469037 /src/runtime/nbpipe_fcntl_unix_test.go
parent301bc66a478198f0edfb5526d84f1d0c8a3d5c05 (diff)
downloadgo-cc4b824e53ef52e1572808c7b7f9b8507516c816.tar.gz
go-cc4b824e53ef52e1572808c7b7f9b8507516c816.zip
runtime: fix nbpipe_test for AIX
Fcntl can't be called using syscall.Syscall as it doesn't work on AIX. Moreover, fcntl isn't exported by syscall package. However, it can be accessed by exporting it from runtime package using export_aix_test.go. Change-Id: Ib6af66d9d7eacb9ca0525ebc4cd4c92951735f1a Reviewed-on: https://go-review.googlesource.com/c/go/+/204059 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/runtime/nbpipe_fcntl_unix_test.go')
-rw-r--r--src/runtime/nbpipe_fcntl_unix_test.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/runtime/nbpipe_fcntl_unix_test.go b/src/runtime/nbpipe_fcntl_unix_test.go
new file mode 100644
index 0000000000..06b3275f06
--- /dev/null
+++ b/src/runtime/nbpipe_fcntl_unix_test.go
@@ -0,0 +1,14 @@
+// Copyright 2019 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 runtime_test
+
+import "syscall"
+
+func fcntl(fd uintptr, cmd int, arg uintptr) (uintptr, syscall.Errno) {
+ res, _, err := syscall.Syscall(syscall.SYS_FCNTL, fd, uintptr(cmd), arg)
+ return res, err
+}