sema_post() returns 0 if successful. When any of the following conditions is detected, sema_post() fails and returns the corresponding value.
EINVAL
Description:sp refers to an invalid semaphore.
EFAULT
Description:sp points to an illegal address.
EOVERFLOW
Description:The semaphore value pointed to by sp exceeds SEM_VALUE_MAX.