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.
$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.15.5
BuildVersion: 19F101
$ brew install gcc
$ curl -O http://www.apuebook.com/src.3e.tar.gz
$ tar xvfz src.3e.tar.gz
$ cd apue.3e/
$ make
$ ls
DISCLAIMER include
Make.defines.freebsd intro
Make.defines.linux ipc1
Make.defines.macos ipc2
Make.defines.solaris lib
Make.libapue.inc printer
Makefile proc
README pty
advio relation
daemons signals
datafiles sockets
db standards
environ stdio
exercises systype.sh
figlinks termios
filedir threadctl
fileio threads
$ 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
$ ./a.out
Recommended Posts