0 Successful completion. The function executes the semaphore lock operation. -1 Indicates an error. The function sets errno to one of the following values: o EAGAIN - The semaphore was already locked and cannot be locked by the sem_trywait operation. o EINVAL - The sem argument does not refer to a valid semaphore. o EVMSERR - OpenVMS specific nontranslatable error code.