github.com/dylandreimerink/gobpfld@v0.6.1-0.20220205171531-e79c330ad608/mmap.go (about)

     1  package gobpfld
     2  
     3  import _ "unsafe" // Need to import unsafe to allow the go:linkname directive
     4  
     5  // mmap is a link to the unexposed syscall.mmap which allows us to call the mmap function without restrictions.
     6  // This is nessessery to allow us to specify our own addr, which we can't via the exported syscall.Mmap function.
     7  //go:linkname mmap syscall.mmap
     8  func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)