OS X KQueue test
Merge FreeBSD with OS X changes