I found a treasure trove of samples from APUE. These can be found at: http://www.csie.ntu.edu.tw/~b92009/zzz88213/SP/example/apue/ You really need the book to understand what is going on.