Error handling in the ANSI library is done using a global variable errno that is set by the library routines and may be tested by a user program. There also are a few functions for error handling:
void assert(int expr); void perror(const char *msg); char * strerror(int errno);