The codes coded myself in the book,Advanced Programming in the UNIX Environment