aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/golang.org/x/sys/unix/gccgo.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/golang.org/x/sys/unix/gccgo.go')
-rw-r--r--vendor/golang.org/x/sys/unix/gccgo.go59
1 files changed, 59 insertions, 0 deletions
diff --git a/vendor/golang.org/x/sys/unix/gccgo.go b/vendor/golang.org/x/sys/unix/gccgo.go
new file mode 100644
index 0000000..aca5721
--- /dev/null
+++ b/vendor/golang.org/x/sys/unix/gccgo.go
@@ -0,0 +1,59 @@
1// Copyright 2015 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//go:build gccgo && !aix && !hurd
6
7package unix
8
9import "syscall"
10
11// We can't use the gc-syntax .s files for gccgo. On the plus side
12// much of the functionality can be written directly in Go.
13
14func realSyscallNoError(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r uintptr)
15
16func realSyscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r, errno uintptr)
17
18func SyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) {
19 syscall.Entersyscall()
20 r := realSyscallNoError(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0)
21 syscall.Exitsyscall()
22 return r, 0
23}
24
25func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) {
26 syscall.Entersyscall()
27 r, errno := realSyscall(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0)
28 syscall.Exitsyscall()
29 return r, 0, syscall.Errno(errno)
30}
31
32func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) {
33 syscall.Entersyscall()
34 r, errno := realSyscall(trap, a1, a2, a3, a4, a5, a6, 0, 0, 0)
35 syscall.Exitsyscall()
36 return r, 0, syscall.Errno(errno)
37}
38
39func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) {
40 syscall.Entersyscall()
41 r, errno := realSyscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9)
42 syscall.Exitsyscall()
43 return r, 0, syscall.Errno(errno)
44}
45
46func RawSyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) {
47 r := realSyscallNoError(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0)
48 return r, 0
49}
50
51func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) {
52 r, errno := realSyscall(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0)
53 return r, 0, syscall.Errno(errno)
54}
55
56func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) {
57 r, errno := realSyscall(trap, a1, a2, a3, a4, a5, a6, 0, 0, 0)
58 return r, 0, syscall.Errno(errno)
59}