github.com/comwrg/go/src@v0.0.0-20220319063731-c238d0440370/runtime/mmap.go (about) 1 // Copyright 2015 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 !aix && !darwin && !js && (!linux || !amd64) && (!linux || !arm64) && !openbsd && !plan9 && !solaris && !windows 6 // +build !aix 7 // +build !darwin 8 // +build !js 9 // +build !linux !amd64 10 // +build !linux !arm64 11 // +build !openbsd 12 // +build !plan9 13 // +build !solaris 14 // +build !windows 15 16 package runtime 17 18 import "unsafe" 19 20 // mmap calls the mmap system call. It is implemented in assembly. 21 // We only pass the lower 32 bits of file offset to the 22 // assembly routine; the higher bits (if required), should be provided 23 // by the assembly routine as 0. 24 // The err result is an OS error code such as ENOMEM. 25 func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uint32) (p unsafe.Pointer, err int) 26 27 // munmap calls the munmap system call. It is implemented in assembly. 28 func munmap(addr unsafe.Pointer, n uintptr)