Semaphore Utility Program

A semaphore utility program is presented in this chapter to facilitate the discussion of semaphore operations. The source code will be presented in modules as each subject area is introduced. This utility will allow you to manipulate all aspects of a semaphore set, including its creation and destruction.

The program will be compiled and tested before the source modules are introduced to allow you to experiment with the topics as the chapter progresses. The remaining additional source for the program will be illustrated at the end of the chapter.

The program is compiled as follows:

$ make cc -c -Wall -DHAVE_SEMUN ctlget.c cc -c -Wall -DHAVE_SEMUN semop.c cc -c -Wall -DHAVE_SEMUN semchmod.c cc -c -Wall -DHAVE_SEMUN semget.c ...

Get Advanced UNIX Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.