it's not "glibc behavior", returning null on error is in the spec
To be fair the API is older than the POSIX spec.