...

Source file src/syscall/syscall_openbsd_libc.go

Documentation: syscall

		 1  // Copyright 2020 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 openbsd
		 6  // +build openbsd
		 7  
		 8  package syscall
		 9  
		10  import (
		11  	"internal/abi"
		12  )
		13  
		14  func init() {
		15  	execveOpenBSD = execve
		16  }
		17  
		18  //sys directSyscall(trap uintptr, a1 uintptr, a2 uintptr, a3 uintptr, a4 uintptr, a5 uintptr) (ret uintptr, err error) = SYS_syscall
		19  
		20  func syscallInternal(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) {
		21  	return syscall6X(abi.FuncPCABI0(libc_syscall_trampoline), trap, a1, a2, a3, 0, 0)
		22  }
		23  
		24  func syscall6Internal(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) {
		25  	return syscall10X(abi.FuncPCABI0(libc_syscall_trampoline), trap, a1, a2, a3, a4, a5, a6, 0, 0, 0)
		26  }
		27  
		28  func rawSyscallInternal(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) {
		29  	return rawSyscall6X(abi.FuncPCABI0(libc_syscall_trampoline), trap, a1, a2, a3, 0, 0)
		30  }
		31  
		32  func rawSyscall6Internal(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) {
		33  	return rawSyscall10X(abi.FuncPCABI0(libc_syscall_trampoline), trap, a1, a2, a3, a4, a5, a6, 0, 0, 0)
		34  }
		35  
		36  func syscall9Internal(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) {
		37  	return rawSyscall10X(abi.FuncPCABI0(libc_syscall_trampoline), trap, a1, a2, a3, a4, a5, a6, a7, a8, a9)
		38  }
		39  
		40  // Implemented in the runtime package (runtime/sys_openbsd3.go)
		41  func syscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno)
		42  func syscallX(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno)
		43  func syscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno)
		44  func syscall6X(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno)
		45  func syscall10(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10 uintptr) (r1, r2 uintptr, err Errno)
		46  func syscall10X(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10 uintptr) (r1, r2 uintptr, err Errno)
		47  func rawSyscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno)
		48  func rawSyscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno)
		49  func rawSyscall6X(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno)
		50  func rawSyscall10X(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10 uintptr) (r1, r2 uintptr, err Errno)
		51  
		52  func syscall9(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) {
		53  	return syscall10(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, 0)
		54  }
		55  func syscall9X(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) {
		56  	return syscall10X(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, 0)
		57  }
		58  
		59  //sys	readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_read
		60  //sys	writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_write
		61  //sys	Seek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_lseek
		62  //sys	getcwd(buf []byte) (n int, err error)
		63  //sys	sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error)
		64  //sysnb fork() (pid int, err error)
		65  //sysnb ioctl(fd int, req int, arg int) (err error)
		66  //sysnb execve(path *byte, argv **byte, envp **byte) (err error)
		67  //sysnb exit(res int) (err error)
		68  //sys	 ptrace(request int, pid int, addr uintptr, data uintptr) (err error)
		69  //sysnb getentropy(p []byte) (err error)
		70  //sys	 fstatat(fd int, path string, stat *Stat_t, flags int) (err error)
		71  //sys	fcntlPtr(fd int, cmd int, arg unsafe.Pointer) (val int, err error) = SYS_fcntl
		72  //sys	 unlinkat(fd int, path string, flags int) (err error)
		73  //sys	 openat(fd int, path string, flags int, perm uint32) (fdret int, err error)
		74  

View as plain text