libScePosix| + sem_count

This commit is contained in:
Martin Baliet 2024-05-05 11:19:44 +02:00
parent f2ab0a150d
commit 4e0e3280d9
2 changed files with 9 additions and 1 deletions

View File

@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.24)
include(ExternalProject)
set(PSOFF_LIB_VERSION v.0.2)
set(PSOFF_LIB_VERSION v.0.3)
set(PSOFF_RENDER_VERSION v.0.5-nightly_04.05.24)
set(ProjectName psOff_${CMAKE_BUILD_TYPE})

View File

@ -40,6 +40,14 @@ EXPORT SYSV_ABI int __NID(sem_post)(boost::interprocess::interprocess_semaphore*
return Ok;
}
EXPORT SYSV_ABI int __NID(sem_getvalue)(boost::interprocess::interprocess_semaphore** sem) {
if (sem == nullptr || *sem == nullptr) {
return POSIX_SET(ErrCode::_ESRCH);
}
return (*sem)->get_count();
return Ok;
}
EXPORT SYSV_ABI int __NID(sem_reltimedwait_np)(boost::interprocess::interprocess_semaphore** sem, SceKernelTimespec* reltime) {
auto now = boost::posix_time::microsec_clock::universal_time();
auto timeout = boost::posix_time::seconds(reltime->tv_sec) + boost::posix_time::microsec(reltime->tv_nsec / 1000);