Usually when you call a function you can determine if there was an error based solely on the return code. But the functions readdir() strtol() and strtoll() are different. For these functions, if you want to know if there was an error then you must set errno to 0 before calling them. Then you can check whether errno is still 0 afterward.
Anyone know of any other common functions with the same behavior?