Source file src/cmd/vendor/golang.org/x/sys/unix/gccgo.go

     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  
     7  package unix
     8  
     9  import "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  
    14  func realSyscallNoError(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r uintptr)
    15  
    16  func realSyscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r, errno uintptr)
    17  
    18  func 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  
    25  func 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  
    32  func 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  
    39  func 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  
    46  func 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  
    51  func 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  
    56  func 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  }
    60  

View as plain text