xref: /aosp_15_r20/external/libcap/psx/psx.go (revision 2810ac1b38eead2603277920c78344c84ddf3aff)
1// +build linux,!cgo
2// +build go1.16
3
4package psx // import "kernel.org/pub/linux/libs/security/libcap/psx"
5
6import "syscall"
7
8// Documentation for these functions are provided in the psx_cgo.go
9// file.
10
11//go:uintptrescapes
12
13// Syscall3 performs a 3 argument syscall.  Syscall3 differs from
14// syscall.[Raw]Syscall() insofar as it is simultaneously executed on
15// every thread of the combined Go and CGo runtimes. It works
16// differently depending on whether CGO_ENABLED is 1 or 0 at compile
17// time.
18//
19// If CGO_ENABLED=1 it uses the libpsx function C.psx_syscall3().
20//
21// If CGO_ENABLED=0 it redirects to the go1.16+
22// syscall.AllThreadsSyscall() function.
23func Syscall3(syscallnr, arg1, arg2, arg3 uintptr) (uintptr, uintptr, syscall.Errno) {
24	return syscall.AllThreadsSyscall(syscallnr, arg1, arg2, arg3)
25}
26
27//go:uintptrescapes
28
29// Syscall6 performs a 6 argument syscall on every thread of the
30// combined Go and CGo runtimes. Other than the number of syscall
31// arguments, its behavior is identical to that of Syscall3() - see
32// above for the full documentation.
33func Syscall6(syscallnr, arg1, arg2, arg3, arg4, arg5, arg6 uintptr) (uintptr, uintptr, syscall.Errno) {
34	return syscall.AllThreadsSyscall6(syscallnr, arg1, arg2, arg3, arg4, arg5, arg6)
35}
36