Please post short examples or sniplets that show the problem. Judging by the description of the book, and by the table of contents, the book teaches normal user-space programming techniques, which should not be Linux-specific, but should work using standard Unix (perhaps SUS or POSIX) interfaces. In that case, it should be easy to adjust the sample code to compile on any Unix system (or any SUS- or POSIX-compliant system).
I just looked at two of the three chapters of the book that are freely downloadable, and they are completely not Linux-specific, and should work on any standard Unix, including *BSD. Matter-of-fact, I wonder why the author named his book "the *Linux* programming interface", if most of it talks about Unix or POSIX, not specifically Linux.
It may also be possible to install some package that includes the Linux header files, perhaps some of the Linux ABI compatibility layer. Not my area of expertise.