github.com/blixtra/rkt@v0.8.1-0.20160204105720-ab0d1add1a43/Godeps/_workspace/src/golang.org/x/sys/unix/gccgo.go (about)

     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  // +build gccgo
     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  //extern gccgoRealSyscall
    15  func realSyscall(trap, a1, a2, a3, a4, a5, a6 uintptr) (r, errno uintptr)
    16  
    17  func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) {
    18  	syscall.Entersyscall()
    19  	r, errno := realSyscall(trap, a1, a2, a3, 0, 0, 0)
    20  	syscall.Exitsyscall()
    21  	return r, 0, syscall.Errno(errno)
    22  }
    23  
    24  func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) {
    25  	syscall.Entersyscall()
    26  	r, errno := realSyscall(trap, a1, a2, a3, a4, a5, a6)
    27  	syscall.Exitsyscall()
    28  	return r, 0, syscall.Errno(errno)
    29  }
    30  
    31  func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) {
    32  	r, errno := realSyscall(trap, a1, a2, a3, 0, 0, 0)
    33  	return r, 0, syscall.Errno(errno)
    34  }
    35  
    36  func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) {
    37  	r, errno := realSyscall(trap, a1, a2, a3, a4, a5, a6)
    38  	return r, 0, syscall.Errno(errno)
    39  }