POSIX wrapper store errno correctly.