mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-05 22:47:03 +00:00
[orbis-kernel] Dummy sys_stat implementation
Ignore shm_open Correct Stat argument for syscalls
This commit is contained in:
parent
9482bd6704
commit
dd9351843b
4 changed files with 45 additions and 16 deletions
|
|
@ -23,8 +23,7 @@ orbis::SysResult orbis::sys_close(Thread *thread, sint fd) {
|
|||
orbis::SysResult orbis::sys_closefrom(Thread *thread, sint lowfd) {
|
||||
return ErrorCode::NOSYS;
|
||||
}
|
||||
orbis::SysResult orbis::sys_fstat(Thread *thread, sint fd,
|
||||
ptr<struct stat> ub) {
|
||||
orbis::SysResult orbis::sys_fstat(Thread *thread, sint fd, ptr<Stat> ub) {
|
||||
return ErrorCode::NOSYS;
|
||||
}
|
||||
orbis::SysResult orbis::sys_nfstat(Thread *thread, sint fd,
|
||||
|
|
|
|||
|
|
@ -1,8 +1,17 @@
|
|||
#include "orbis-config.hpp"
|
||||
#include "sys/sysproto.hpp"
|
||||
#include "utils/Logs.hpp"
|
||||
|
||||
orbis::SysResult orbis::sys_shm_open(Thread *thread, ptr<const char> path,
|
||||
sint flags, mode_t mode) {
|
||||
return ErrorCode::NOSYS;
|
||||
char _name[256];
|
||||
if (auto result = ureadString(_name, sizeof(_name), path);
|
||||
result != ErrorCode{}) {
|
||||
return result;
|
||||
}
|
||||
|
||||
ORBIS_LOG_TODO(__FUNCTION__, _name, flags, mode);
|
||||
return {};
|
||||
}
|
||||
orbis::SysResult orbis::sys_shm_unlink(Thread *thread, ptr<const char> path) {
|
||||
return ErrorCode::NOSYS;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
#include "stat.hpp"
|
||||
#include "sys/sysproto.hpp"
|
||||
#include "utils/Logs.hpp"
|
||||
|
||||
|
|
@ -103,16 +104,36 @@ orbis::SysResult orbis::sys_eaccess(Thread *thread, ptr<char> path,
|
|||
sint flags) {
|
||||
return ErrorCode::NOSYS;
|
||||
}
|
||||
orbis::SysResult orbis::sys_stat(Thread *thread, ptr<char> path,
|
||||
ptr<struct stat> ub) {
|
||||
return ErrorCode::NOSYS;
|
||||
orbis::SysResult orbis::sys_stat(Thread *thread, ptr<char> path, ptr<Stat> ub) {
|
||||
ORBIS_LOG_TODO(__FUNCTION__, path, ub);
|
||||
auto result = sys_open(thread, path, 0, 0);
|
||||
if (result.isError()) {
|
||||
return result;
|
||||
}
|
||||
|
||||
auto fd = thread->retval[0];
|
||||
result = sys_lseek(thread, fd, 0, SEEK_END);
|
||||
if (result.isError()) {
|
||||
sys_close(thread, fd);
|
||||
return result;
|
||||
}
|
||||
|
||||
auto len = thread->retval[0];
|
||||
*ub = {};
|
||||
ub->size = len;
|
||||
ub->blksize = 1;
|
||||
ub->blocks = len;
|
||||
ub->mode = 0777;
|
||||
sys_close(thread, fd);
|
||||
thread->retval[0] = 0;
|
||||
return {};
|
||||
}
|
||||
orbis::SysResult orbis::sys_fstatat(Thread *thread, sint fd, ptr<char> path,
|
||||
ptr<struct stat> buf, sint flag) {
|
||||
ptr<Stat> buf, sint flag) {
|
||||
return ErrorCode::NOSYS;
|
||||
}
|
||||
orbis::SysResult orbis::sys_lstat(Thread *thread, ptr<char> path,
|
||||
ptr<struct stat> ub) {
|
||||
ptr<Stat> ub) {
|
||||
return ErrorCode::NOSYS;
|
||||
}
|
||||
orbis::SysResult orbis::sys_nstat(Thread *thread, ptr<char> path,
|
||||
|
|
@ -257,7 +278,7 @@ orbis::sys_fhopen(Thread *thread, ptr<const struct fhandle> u_fhp, sint flags) {
|
|||
}
|
||||
orbis::SysResult orbis::sys_fhstat(Thread *thread,
|
||||
ptr<const struct fhandle> u_fhp,
|
||||
ptr<struct stat> sb) {
|
||||
ptr<Stat> sb) {
|
||||
return ErrorCode::NOSYS;
|
||||
}
|
||||
orbis::SysResult orbis::sys_fhstatfs(Thread *thread,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue