aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/nbpipe_fcntl_libc_test.go
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2019-11-07 21:04:53 -0800
committerIan Lance Taylor <iant@golang.org>2019-11-08 19:28:57 +0000
commit904e1136c226b2b6ca31969acbf90ae44ecf8dc0 (patch)
treeb4c26af81684e45ba835ca645632bc203fd225ad /src/runtime/nbpipe_fcntl_libc_test.go
parentf6ff806e48ca48f080d1534e2c8ef4db84abdb7e (diff)
downloadgo-904e1136c226b2b6ca31969acbf90ae44ecf8dc0.tar.gz
go-904e1136c226b2b6ca31969acbf90ae44ecf8dc0.zip
runtime: add pipe/pipe2 on Solaris
This adds pipe/pipe2 on Solaris as they exist on other Unix systems. They were not added previously because Solaris does not need them for netpollBreak. They are added now in preparation for using pipes in TestSignalM. Updates #35276 Change-Id: I53dfdf077430153155f0a79715af98b0972a841c Reviewed-on: https://go-review.googlesource.com/c/go/+/206077 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/runtime/nbpipe_fcntl_libc_test.go')
-rw-r--r--src/runtime/nbpipe_fcntl_libc_test.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/runtime/nbpipe_fcntl_libc_test.go b/src/runtime/nbpipe_fcntl_libc_test.go
new file mode 100644
index 0000000000..70f4b8348b
--- /dev/null
+++ b/src/runtime/nbpipe_fcntl_libc_test.go
@@ -0,0 +1,18 @@
+// 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 aix solaris
+
+package runtime_test
+
+import (
+ "runtime"
+ "syscall"
+)
+
+// Call fcntl libc function rather than calling syscall.
+func fcntl(fd uintptr, cmd int, arg uintptr) (uintptr, syscall.Errno) {
+ res, errno := runtime.Fcntl(fd, uintptr(cmd), arg)
+ return res, syscall.Errno(errno)
+}