What most sane libc functions return on error. Seems to be great UNIX tradition, though some things like POSIX threads break it.

If the function returns a pointer, then it's obviously going to return NULL on error. I was using an old Borland DOS compiler only to see it returned -7 on error, how crazy/random is that?!