github.com/pidato/unsafe@v0.1.4/cgo/call_libfuzzer.go (about) 1 //go:build libfuzzer && (amd64 || arm64) 2 3 package cgo 4 5 import _ "unsafe" 6 7 // NonBlocking C function fn without going all the way through cgo. 8 // Example: NonBlocking((*byte)(C.my_c_func), 0, 0) 9 // void my_c_func(size_t arg0, size_t arg1) { 10 // } 11 //go:noescape 12 //go:nosplit 13 //go:linkname NonBlocking runtime.libfuzzerCall 14 func NonBlocking(fn *byte, arg0, arg1 uintptr) 15 16 func Blocking(fn *byte, arg0, arg1 uintptr) { 17 cgo.Call(fn, arg0, arg1) 18 }