|No such thing as a small change|
Understanding Unix/Linux Programmingby Steve_p (Priest)
|on Feb 18, 2003 at 17:00 UTC||Need Help??|
Order Understanding Unix/Linux Programming
Item Description: A Guide to Theory and Practice
Review Synopsis: The book I wish I had seven years ago.
For years, the C community has lacked the intermediate level books to help the beginner along to the advanced topics in C programming. The gap between Learn C in 5 Minutes and Advanced UNIX Programming is rather large. The new book Understanding Unix/Linux Programming has finally bridged the gap. It is definitely the book I needed seven years ago when starting out professionally as a C programmer.
The goal of the book, as stated in the first chapter, is to understand system programming in UNIX. Rather than the abstract examples in most books, the author looking at system commands on a Unix system, figuring out how they work, then writing your own version.
The book takes a case study-type approach to each chapter. It begins by discussing the functionality of a command or program to study, and then goes through building it step by step. For example, when developing who, the case study begins by simply reading in everything in the utmp file, then modifying bit by bit until it works the same as who (without parameters) does on Unix. This was an easy approach for me to follow since this is essentially the approach I follow when developing a new program. There are some sidetracks in the chapter into other related subjects. For example, when studying who, a library for reading utmp-type files is created with buffered I/O. That discussion is started by re-writing cp. There is also a discussion regarding how utmp records are created by the kernel. Each chapter ends with several Explorations, Programming Exercises, and Projects. So those of you who agreed with Do your homework! will have a lot to work with.
The book continues on with the same model discussing nearly everything left out of the introductory C texts. Some other projects include writing pong using curses, developing a simple shell, and, finally, developing a multi-threaded http server.
Well, that's enough gushing, its now time for the gripes. This book does take a rather non-BSD slant, so you BSD users out there, like myself, have to adapt to make some of the examples work. It starts out early. If there is one place the greatly differs between the BSD and Unix/Linux flavors is utmp.h. While this was an annoyance to me, the spoon-fed types out there may not take the time to dig a bit to get the right answers and get turned off quickly. Also, with all the work on network programming, one would think security would be at least discussed, but it wasn't.
Overall, this is one of the best books I've read on Unix development that I have read, and I am glad to add it my bookshelf. I highly recommend it for anyone developing on any Unix system. Also, if you are looking into XS, it would be a great help to go along with Extending and Embedding Perl.