// Copyright 2022 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// Package syscall provides the syscall primitives required for the runtime.
package syscall import ( ) // TODO(https://go.dev/issue/51087): This package is incomplete and currently // only contains very minimal support for Linux. // Syscall6 calls system call number 'num' with arguments a1-6. func (, , , , , , uintptr) (, , uintptr) func ( int32) ( int32, uintptr) { , , := Syscall6(SYS_EPOLL_CREATE1, uintptr(), 0, 0, 0, 0, 0) return int32(), } var _zero uintptr func ( int32, []EpollEvent, , int32) ( int32, uintptr) { var unsafe.Pointer if len() > 0 { = unsafe.Pointer(&[0]) } else { = unsafe.Pointer(&_zero) } , , := Syscall6(SYS_EPOLL_PWAIT, uintptr(), uintptr(), uintptr(), uintptr(), 0, 0) return int32(), } func (, , int32, *EpollEvent) ( uintptr) { , , := Syscall6(SYS_EPOLL_CTL, uintptr(), uintptr(), uintptr(), uintptr(unsafe.Pointer()), 0, 0) return } func (, int32) ( int32, uintptr) { , , := Syscall6(SYS_EVENTFD2, uintptr(), uintptr(), 0, 0, 0, 0) return int32(), } func ( *byte, int, uint32) ( int, uintptr) { // Use SYS_OPENAT to match the syscall package. := AT_FDCWD , , := Syscall6(SYS_OPENAT, uintptr(), uintptr(unsafe.Pointer()), uintptr(|O_LARGEFILE), uintptr(), 0, 0) return int(), } func ( int) ( uintptr) { , , := Syscall6(SYS_CLOSE, uintptr(), 0, 0, 0, 0, 0) return } func ( int, []byte) ( int, uintptr) { var unsafe.Pointer if len() > 0 { = unsafe.Pointer(&[0]) } else { = unsafe.Pointer(&_zero) } , , := Syscall6(SYS_READ, uintptr(), uintptr(), uintptr(len()), 0, 0, 0) return int(), } func ( int, []byte, int64) ( int, uintptr) { var unsafe.Pointer if len() > 0 { = unsafe.Pointer(&[0]) } else { = unsafe.Pointer(&_zero) } var , uintptr switch goarch.GOARCH { case "386": , _, = Syscall6(SYS_PREAD64, uintptr(), uintptr(), uintptr(len()), uintptr(), uintptr(>>32), 0) case "arm", "mipsle": , _, = Syscall6(SYS_PREAD64, uintptr(), uintptr(), uintptr(len()), 0, uintptr(), uintptr(>>32)) case "mips": , _, = Syscall6(SYS_PREAD64, uintptr(), uintptr(), uintptr(len()), 0, uintptr(>>32), uintptr()) default: , _, = Syscall6(SYS_PREAD64, uintptr(), uintptr(), uintptr(len()), uintptr(), 0, 0) } return int(), }