Summary

In this chapter, the general philosophy behind the UNIX C library method of reporting success and failure has been covered. You have studied the global variable errno and learned how to declare it and use it. Also very importantly, you learned when the value of errno is valid.

You have seen the different ways that error codes can be converted into a user-friendly message. Some of the pitfalls of error reporting were also examined, such as that of detecting an error too late with the function ferror(3).

While this chapter has been a review for seasoned programmers, this material is vitally important to those that are just starting out programming for UNIX. With this foundation, you are better equipped to tackle the upcoming chapters successfully. ...

Get Advanced UNIX Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.