mmap_netbsd_64.go 673 B

12345678910111213141516171819202122
  1. // Copyright 2009 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-GO file.
  4. //go:build netbsd && amd64
  5. // +build netbsd,amd64
  6. package memory
  7. import (
  8. "syscall"
  9. )
  10. // https://cs.opensource.google/go/go/+/refs/tags/go1.17.8:src/syscall/zsyscall_netbsd_amd64.go;l=1190
  11. func mmapSyscall(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {
  12. r0, _, e1 := syscall.Syscall9(syscall.SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), 0, uintptr(pos), 0, 0)
  13. ret = uintptr(r0)
  14. if e1 != 0 {
  15. err = e1
  16. }
  17. return
  18. }