Fixes line truncation in musl. As @chneukirchen pointed out, POSIX does not need to set errno. Just use its return value.