The Kindle book sale was half price, so I bought a book called Detailed UNIX Programming and started reading it.
When I tried to run the sample code on a Mac, I stumbled on various things, so I will leave the steps I took to make it work.
ProductName: Mac OS X
$ brew install gcc
$ curl -O http://www.apuebook.com/src.3e.tar.gz
$ tar xvfz src.3e.tar.gz
$ cd apue.3e/
$ cp include/apue.h /usr/local/include/
$ cp lib/libapue.a /usr/local/lib/
$cd The path of the directory where the files you wrote are located
#This time, myls.Suppose you compile code c
#Compile with apue library
$ gcc -lapue myls.c
# a.A file called out will be generated, so check that it can be executed