OpenBSD portability enhancements (bug 1002)