// 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 syscallimport ()// 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)// syscall_RawSyscall6 is a push linkname to export Syscall6 as// syscall.RawSyscall6.//// //go:uintptrkeepalive because the uintptr argument may be converted pointers// that need to be kept alive in the caller (this is implied for Syscall6 since// it has no body).//// //go:nosplit because stack copying does not account for uintptrkeepalive, so// the stack must not grow. Stack copying cannot blindly assume that all// uintptr arguments are pointers, because some values may look like pointers,// but not really be pointers, and adjusting their value would break the call.//// This is a separate wrapper because we can't export one function as two// names. The assembly implementations name themselves Syscall6 would not be// affected by a linkname.////go:uintptrkeepalive//go:nosplit//go:linkname syscall_RawSyscall6 syscall.RawSyscall6func (, , , , , , uintptr) (, , uintptr) {returnSyscall6(, , , , , , )}func ( int32) ( int32, uintptr) { , , := Syscall6(SYS_EPOLL_CREATE1, uintptr(), 0, 0, 0, 0, 0)returnint32(), }var_zerouintptrfunc ( int32, []EpollEvent, , int32) ( int32, uintptr) {varunsafe.Pointeriflen() > 0 { = unsafe.Pointer(&[0]) } else { = unsafe.Pointer(&_zero) } , , := Syscall6(SYS_EPOLL_PWAIT, uintptr(), uintptr(), uintptr(), uintptr(), 0, 0)returnint32(), }func (, , int32, *EpollEvent) ( uintptr) { , , := Syscall6(SYS_EPOLL_CTL, uintptr(), uintptr(), uintptr(), uintptr(unsafe.Pointer()), 0, 0)return}
The pages are generated with Goldsv0.6.7. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds.