Use sema_post(3C) to atomically increment the semaphore pointed to by sp. When any threads are blocked on the semaphore, one thread is unblocked.
#include <thread.h> int sema_post(sema_t *sp);
sp refers to an invalid semaphore.
sp points to an illegal address.
The semaphore value pointed to by sp exceeds SEM_VALUE_MAX.