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

     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  
     5  //go:build (freebsd && amd64) || (freebsd && arm64)
     6  // +build freebsd,amd64 freebsd,arm64
     7  
     8  package memory
     9  
    10  import (
    11  	"syscall"
    12  )
    13  
    14  // https://cs.opensource.google/go/go/+/refs/tags/go1.17.8:src/syscall/zsyscall_freebsd_amd64.go;l=1337-1346
    15  func mmapSyscall(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {
    16  	r0, _, e1 := syscall.Syscall6(syscall.SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos))
    17  	ret = uintptr(r0)
    18  	if e1 != 0 {
    19  		err = e1
    20  	}
    21  	return
    22  }