cgo: applied BSD fix to Linux code (just in case!)