blob: 0dee23222ca803f4327364537458b379eb5ac4ba [file] [log] [blame]
Don Newton98fd8812019-09-23 15:15:02 -04001// 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
David K. Bainbridgee05cf0c2021-08-19 03:16:50 +00005//go:build gccgo && !aix
6// +build gccgo,!aix
Don Newton98fd8812019-09-23 15:15:02 -04007
8package unix
9
10import "syscall"
11
12// We can't use the gc-syntax .s files for gccgo. On the plus side
13// much of the functionality can be written directly in Go.
14
Don Newton98fd8812019-09-23 15:15:02 -040015func realSyscallNoError(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r uintptr)
16
Don Newton98fd8812019-09-23 15:15:02 -040017func realSyscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r, errno uintptr)
18
19func SyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) {
20 syscall.Entersyscall()
21 r := realSyscallNoError(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0)
22 syscall.Exitsyscall()
23 return r, 0
24}
25
26func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) {
27 syscall.Entersyscall()
28 r, errno := realSyscall(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0)
29 syscall.Exitsyscall()
30 return r, 0, syscall.Errno(errno)
31}
32
33func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) {
34 syscall.Entersyscall()
35 r, errno := realSyscall(trap, a1, a2, a3, a4, a5, a6, 0, 0, 0)
36 syscall.Exitsyscall()
37 return r, 0, syscall.Errno(errno)
38}
39
40func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) {
41 syscall.Entersyscall()
42 r, errno := realSyscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9)
43 syscall.Exitsyscall()
44 return r, 0, syscall.Errno(errno)
45}
46
47func RawSyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) {
48 r := realSyscallNoError(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0)
49 return r, 0
50}
51
52func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) {
53 r, errno := realSyscall(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0)
54 return r, 0, syscall.Errno(errno)
55}
56
57func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) {
58 r, errno := realSyscall(trap, a1, a2, a3, a4, a5, a6, 0, 0, 0)
59 return r, 0, syscall.Errno(errno)
60}