Multithreaded Programming Guide

Linking With -lrt for POSIX Semaphores

The Solaris semaphore routines, sema_*(3C), are contained in the standard C library. By contrast, you link with the -lrt library to get the standard sem_*(3RT) POSIX semaphore routines described in Synchronization With Semaphores.