diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e96736..db854bd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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}) diff --git a/modules/libScePosix/entry.cpp b/modules/libScePosix/entry.cpp index 289890c..7e7ce18 100644 --- a/modules/libScePosix/entry.cpp +++ b/modules/libScePosix/entry.cpp @@ -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);