mmap_darwin.go 633 B

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