Well, at least in Unix, only system calls set errno; regular library routines need to use some other method of reporting errors...