mirror of
https://github.com/RPCSX/rpcsx.git
synced 2024-11-27 05:10:53 +00:00
[orbis-kenel] implement sys_access
fix shm_unlink
This commit is contained in:
parent
e9dfaf2573
commit
044c86dc3f
@ -1,5 +1,13 @@
|
||||
#include "sys/sysproto.hpp"
|
||||
|
||||
namespace orbis {
|
||||
struct rlimit {
|
||||
int64_t softLimit;
|
||||
int64_t hardLimit;
|
||||
};
|
||||
} // namespace orbis
|
||||
|
||||
|
||||
orbis::SysResult orbis::sys_getpriority(Thread *thread, sint which, sint who) {
|
||||
return ErrorCode::NOSYS;
|
||||
}
|
||||
@ -23,7 +31,55 @@ orbis::SysResult orbis::sys_setrlimit(Thread *thread, uint which,
|
||||
}
|
||||
orbis::SysResult orbis::sys_getrlimit(Thread *thread, uint which,
|
||||
ptr<struct rlimit> rlp) {
|
||||
return ErrorCode::NOSYS;
|
||||
switch (which) {
|
||||
case 0: { // cpu
|
||||
break;
|
||||
}
|
||||
case 1: { // fsize
|
||||
break;
|
||||
}
|
||||
case 2: { // data
|
||||
break;
|
||||
}
|
||||
case 3: { // stack
|
||||
break;
|
||||
}
|
||||
case 4: { // core
|
||||
break;
|
||||
}
|
||||
case 5: { // rss
|
||||
break;
|
||||
}
|
||||
case 6: { // memlock
|
||||
break;
|
||||
}
|
||||
case 7: { // nproc
|
||||
break;
|
||||
}
|
||||
case 8: { // nofile
|
||||
break;
|
||||
}
|
||||
case 9: { // sbsize
|
||||
break;
|
||||
}
|
||||
case 10: { // vmem
|
||||
break;
|
||||
}
|
||||
case 11: { // npts
|
||||
break;
|
||||
}
|
||||
case 12: { // swap
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
return ErrorCode::INVAL;
|
||||
}
|
||||
|
||||
rlp->softLimit = 4096;
|
||||
rlp->hardLimit = 4096;
|
||||
|
||||
return {};
|
||||
}
|
||||
orbis::SysResult orbis::sys_getrusage(Thread *thread, sint who,
|
||||
ptr<struct rusage> rusage) {
|
||||
|
@ -146,6 +146,11 @@ orbis::SysResult orbis::sys_freebsd6_lseek(Thread *thread, sint fd, sint,
|
||||
return sys_lseek(thread, fd, offset, whence);
|
||||
}
|
||||
orbis::SysResult orbis::sys_access(Thread *thread, ptr<char> path, sint flags) {
|
||||
if (auto open = thread->tproc->ops->open) {
|
||||
Ref<File> file;
|
||||
return open(thread, path, flags, 0, &file);
|
||||
}
|
||||
|
||||
return ErrorCode::NOSYS;
|
||||
}
|
||||
orbis::SysResult orbis::sys_faccessat(Thread *thread, sint fd, ptr<char> path,
|
||||
|
@ -358,7 +358,7 @@ orbis::SysResult socket(orbis::Thread *thread, orbis::ptr<const char> name,
|
||||
|
||||
orbis::SysResult shm_unlink(orbis::Thread *thread, const char *path) {
|
||||
auto dev = static_cast<IoDevice *>(orbis::g_context.shmDevice.get());
|
||||
return dev->unlink(getAbsolutePath(path, thread).c_str(), false, thread);
|
||||
return dev->unlink(path, false, thread);
|
||||
}
|
||||
|
||||
orbis::SysResult dynlib_get_obj_member(orbis::Thread *thread,
|
||||
|
Loading…
Reference in New Issue
Block a user