Multithreaded Programming Guide

Linking With -lposix4 for POSIX Semaphores

The Solaris semaphore routines, sema_*(3T), are contained in the libthread library. By contrast, you link with the -lposix4 library to get the standard sem_*(3R) POSIX 1003.1c semaphore routines described in "Semaphores".