posix tools portability fixes