| 1 |
// Copyright 2022 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 |
// Package syscall provides the syscall primitives required for the runtime. |
| 6 |
package syscall |
| 7 |
|
| 8 |
// TODO(https://go.dev/issue/51087): This package is incomplete and currently |
| 9 |
// only contains very minimal support for Linux. |
| 10 |
|
| 11 |
//extern __go_syscall6 |
| 12 |
func syscall6(num uintptr, a1, a2, a3, a4, a5, a6 uintptr) uintptr |
| 13 |
|
| 14 |
func getErrno() uintptr |
| 15 |
func setErrno(uintptr) |
| 16 |
|
| 17 |
// Syscall6 calls system call number 'num' with arguments a1-6. |
| 18 |
func Syscall6(num, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, errno uintptr) { |
| 19 |
setErrno(0) |
| 20 |
r := syscall6(num, a1, a2, a3, a4, a5, a6) |
| 21 |
errno = getErrno() |
| 22 |
return r, 0, errno |
| 23 |
} |