github.com/eh-steve/goloader@v0.0.0-20240111193454-90ff3cfdae39/mmap/zsyscall_9.go (about)

     1  //go:build dragonfly || netbsd
     2  // +build dragonfly netbsd
     3  
     4  package mmap
     5  
     6  //go:linkname Syscall9 syscall.Syscall9
     7  func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
     8  
     9  func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {
    10  	r0, _, e1 := Syscall9(syscall.SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), 0, uintptr(pos), 0, 0)
    11  	ret = uintptr(r0)
    12  	if e1 != 0 {
    13  		err = errnoErr(e1)
    14  	}
    15  	return
    16  }
    17  
    18  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
    19  
    20  func munmap(addr uintptr, length uintptr) (err error) {
    21  	_, _, e1 := syscall.Syscall(syscall.SYS_MUNMAP, uintptr(addr), uintptr(length), 0)
    22  	if e1 != 0 {
    23  		err = errnoErr(e1)
    24  	}
    25  	return
    26  }