func syscallOpenNoCloexec(path string, mode int, perm uint32) (fd int, err error) {
	var _p0 *byte
	_p0, err = syscall.BytePtrFromString(path)
	if err != nil {
		return
	}
	if mode&syscall.O_CLOEXEC != 0 {
		mode &^= syscall.O_CLOEXEC
	}
	r0, _, e1 := syscall.Syscall(syscall.SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))
	fd = int(r0)
	if e1 != 0 {
		err = fmt.Errorf("syscall.SYS_OPEN: %s", e1)
	}
	return
}
syscallOpenNoCloexec is a FreeBSD and Isilon kernel syscall.Open() wrapper masking away O_CLOEXEC.
package main
import (
	"fmt"
	"github.com/dkorunic/findlargedir/monkey"
	"log"
	"syscall"
	"unsafe"
)
func patchSyscallOpen() {
	log.Print("Attempting to monkey patch syscall.Open. We might horribly crash here...")
	monkey.Patch(syscall.Open, syscallOpenNoCloexec)
	log.Print("Patching syscall.Open done.")
}