!195 feat: L0新增posix接口sem_getvalue

Merge pull request !195 from x_xiny/master
This commit is contained in:
openharmony_ci
2021-06-24 07:15:06 +00:00
committed by Gitee
3 changed files with 32 additions and 0 deletions

View File

@@ -186,3 +186,21 @@ int sem_timedwait(sem_t *sem, const struct timespec *timeout)
return 0;
}
int sem_getvalue(sem_t *sem, int *currVal)
{
UINT32 ret;
if ((sem == NULL) || (currVal == NULL)) {
errno = EINVAL;
return -1;
}
ret = LOS_SemGetValue(sem->s_handle, currVal);
if (ret) {
errno = EINVAL;
return -1;
}
return LOS_OK;
}