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