modernc.org/memory@v1.8.0/mmap_darwin.go (about)

     1  // Copyright 2017 The Memory 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 amd64 || arm64
     6  // +build amd64 arm64
     7  
     8  package memory
     9  
    10  import (
    11  	_ "unsafe"
    12  )
    13  
    14  // Function syscall.mmap for darwin and openbsd calls internal/abi.FuncPCABI0,
    15  // which is implemented as a compile intrinsic so the code cannot be reused.
    16  // Using go:linkname directive to link mmapSyscall to syscall.mmap
    17  
    18  //go:linkname mmapSyscall syscall.mmap
    19  func mmapSyscall(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)