Source file src/runtime/mmap.go

     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 || arm64 || loong64)) || (freebsd && amd64)) && !openbsd && !plan9 && !solaris && !windows
     6  
     7  package runtime
     8  
     9  import "unsafe"
    10  
    11  // mmap calls the mmap system call. It is implemented in assembly.
    12  // We only pass the lower 32 bits of file offset to the
    13  // assembly routine; the higher bits (if required), should be provided
    14  // by the assembly routine as 0.
    15  // The err result is an OS error code such as ENOMEM.
    16  func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uint32) (p unsafe.Pointer, err int)
    17  
    18  // munmap calls the munmap system call. It is implemented in assembly.
    19  func munmap(addr unsafe.Pointer, n uintptr)
    20  

View as plain text